[MERGE] merge with parent branch

bzr revid: rma@tinyerp.com-20120928050544-vduavy8n5w0saipg
This commit is contained in:
Randhir Mayatra (OpenERP)
2012-09-28 10:35:44 +05:30
52 changed files with 2057 additions and 2841 deletions
+2 -2
View File
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2012-09-27 04:36+0000\n"
"X-Generator: Launchpad (build 16033)\n"
"X-Launchpad-Export-Date: 2012-09-28 04:39+0000\n"
"X-Generator: Launchpad (build 16043)\n"
#. module: account_coda
#: model:account.coda.trans.code,description:account_coda.actcc_09_21
+8 -1
View File
@@ -782,9 +782,16 @@ class account_voucher(osv.osv):
vals[key].update(res[key])
return vals
def button_proforma_voucher(self, cr, uid, ids, context=None):
context = context or {}
wf_service = netsvc.LocalService("workflow")
for vid in ids:
wf_service.trg_validate(uid, 'account.voucher', vid, 'proforma_voucher', cr)
return {'type': 'ir.actions.act_window_close'}
def proforma_voucher(self, cr, uid, ids, context=None):
self.action_move_line_create(cr, uid, ids, context=context)
return {'type': 'ir.actions.act_window_close'}
return True
def action_cancel_draft(self, cr, uid, ids, context=None):
wf_service = netsvc.LocalService("workflow")
+6 -5
View File
@@ -27,11 +27,12 @@ class invoice(osv.osv):
def invoice_pay_customer(self, cr, uid, ids, context=None):
if not ids: return []
mod,modid = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account_voucher', 'view_vendor_receipt_dialog_form')
inv = self.browse(cr, uid, ids[0], context=context)
return {
'name':_("Pay Invoice"),
'view_mode': 'form',
'view_id': False,
'view_id': modid,
'view_type': 'form',
'res_model': 'account.voucher',
'type': 'ir.actions.act_window',
@@ -41,13 +42,13 @@ class invoice(osv.osv):
'context': {
'default_partner_id': inv.partner_id.id,
'default_amount': inv.type in ('out_refund', 'in_refund') and -inv.residual or inv.residual,
'default_name':inv.name,
'default_number':inv.name,
'close_after_process': True,
'invoice_type':inv.type,
'invoice_id':inv.id,
'invoice_type': inv.type,
'invoice_id': inv.id,
'default_type': inv.type in ('out_invoice','out_refund') and 'receipt' or 'payment',
'type': inv.type in ('out_invoice','out_refund') and 'receipt' or 'payment'
}
}
}
invoice()
@@ -284,6 +284,111 @@
<menuitem action="action_vendor_payment" icon="STOCK_JUSTIFY_FILL" sequence="12"
id="menu_action_vendor_payment" parent="account.menu_finance_payables"/>
<record model="ir.ui.view" id="view_vendor_receipt_dialog_form">
<field name="name">account.voucher.receipt.dialog.form</field>
<field name="model">account.voucher</field>
<field name="priority">30</field>
<field name="arch" type="xml">
<form string="Payment" version="7.0">
<group>
<group>
<field name="state" invisible="1"/>
<field name="partner_id" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" string="Customer" context="{'search_default_customer': 1}"/>
<label for="amount" string="Paid Amount"/>
<div>
<field name="amount" class="oe_inline"
invisible="context.get('line_type', False)"
on_change="onchange_amount(amount, payment_rate, partner_id, journal_id, currency_id, type, date, payment_rate_currency_id, company_id, context)"/>
<field name="currency_id" class="oe_inline"/>
</div>
<field name="journal_id"
domain="[('type','in',['bank', 'cash'])]"
invisible="context.get('line_type', False)"
widget="selection"
on_change="onchange_journal(journal_id, line_cr_ids, False, partner_id, date, amount, type, company_id, context)"
string="Payment Method"/>
</group>
<group>
<field name="date" invisible="context.get('line_type', False)" on_change="onchange_date(date, currency_id, payment_rate_currency_id, amount, company_id, context)"/>
<field name="reference" invisible="context.get('line_type', False)" string="Payment Ref" placeholder="e.g. 003/10"/>
<field name="name" colspan="2" invisible="context.get('line_type', False)" placeholder="e.g. Invoice SAJ/0042"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<field name="account_id"
widget="selection"
invisible="True"/>
<field name="pre_line" invisible="1"/>
<field name="type" invisible="True"/>
</group>
</group>
<notebook invisible="1">
<page string="Payment Information" groups="base.group_user">
<label for="line_cr_ids"/>
<field name="line_cr_ids" context="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount, currency_id, type, context)">
<tree string="Invoices and outstanding transactions" editable="bottom" colors="gray:amount==0">
<field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
on_change="onchange_move_line_id(move_line_id)"
domain="[('account_id.type','in',('receivable','payable')), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]"
required="1"
groups="account.group_account_user"/>
<field name="account_id" groups="base.group_no_one" domain="[('type','=','receivable')]"/>
<field name="date_original" readonly="1"/>
<field name="date_due" readonly="1"/>
<field name="amount_original" readonly="1"/>
<field name="amount_unreconciled" readonly="1" groups="account.group_account_user"/>
<field name="reconcile" on_change="onchange_reconcile(reconcile, amount, amount_unreconciled, context)" groups="account.group_account_user"/>
<field name="amount" sum="Total Allocation" on_change="onchange_amount(amount, amount_unreconciled, context)" string="Allocation"/>
</tree>
</field>
<label for="line_dr_ids" attrs="{'invisible': [('pre_line','=',False)]}"/>
<field name="line_dr_ids" attrs="{'invisible': [('pre_line','=',False)]}" context="{'journal_id':journal_id, 'partner_id':partner_id}" on_change="onchange_line_ids(line_dr_ids, line_cr_ids, amount, currency_id, type, context)">
<tree string="Credits" editable="bottom" colors="gray:amount==0">
<field name="move_line_id" context="{'journal_id':parent.journal_id, 'partner_id':parent.partner_id}"
on_change="onchange_move_line_id(move_line_id)"
domain="[('account_id.type','in',('receivable','payable')), ('reconcile_id','=', False), ('partner_id','=',parent.partner_id)]"
required="1"/>
<field name="account_id" groups="base.group_no_one" domain="[('type','=','receivable')]"/>
<field name="date_original" readonly="1"/>
<field name="date_due" readonly="1"/>
<field name="amount_original" readonly="1"/>
<field name="amount_unreconciled" readonly="1"/>
<field name="reconcile" on_change="onchange_reconcile(reconcile, amount, amount_unreconciled, context)"/>
<field name="amount" sum="Total Allocation" on_change="onchange_amount(amount, amount_unreconciled, context)" string="Allocation"/>
</tree>
</field>
<group col="3">
<group>
<field name="narration" colspan="2" nolabel="1"/>
</group>
<group col="4" attrs="{'invisible':[('currency_id','=',False),('is_multi_currency','=',False)]}">
<field name="is_multi_currency" invisible="1"/>
<field name="payment_rate" required="1" on_change="onchange_rate(payment_rate, amount, currency_id, payment_rate_currency_id, company_id, context)" colspan="3"/>
<field name="payment_rate_currency_id" colspan="1" nolabel="1" on_change="onchange_payment_rate_currency(currency_id, payment_rate, payment_rate_currency_id, date, amount, company_id, context)" groups="base.group_multi_currency"/>
<field name="paid_amount_in_company_currency" colspan="4" invisible="1"/>
</group>
<group>
<field name="writeoff_amount"/>
<field name="payment_option" required="1"/>
<field name="writeoff_acc_id"
attrs="{'invisible':[('payment_option','!=','with_writeoff')], 'required':[('payment_option','=','with_writeoff')]}"
domain="[('type','=','other')]"/>
<field name="comment"
attrs="{'invisible':[('payment_option','!=','with_writeoff')]}"/>
<field name="analytic_id"
groups="analytic.group_analytic_accounting"/>
</group>
</group>
</page>
</notebook>
<footer>
<button name="button_proforma_voucher" string="Pay" class="oe_highlight" type="object"/> or
<button string="Cancel" class="oe_link" special="cancel"/>
</footer>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_vendor_receipt_form">
<field name="name">account.voucher.receipt.form</field>
<field name="model">account.voucher</field>
@@ -297,7 +402,7 @@
<field name="state" widget="statusbar" statusbar_visible="draft,posted" statusbar_colors='{"proforma":"blue"}'/>
</header>
<sheet>
<h1><field name="number"/></h1>
<h1 attrs="{'invisible': [('number','=',False)]}"><field name="number"/></h1>
<group>
<group>
<field name="partner_id" domain="[('customer','=',True)]" required="1" invisible="context.get('line_type', False)" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" string="Customer" context="{'search_default_customer': 1}"/>
@@ -329,7 +434,6 @@
<field name="type" invisible="True"/>
</group>
</group>
<notebook>
<page string="Payment Information" groups="base.group_user">
<label for="line_cr_ids"/>
+1
View File
@@ -102,6 +102,7 @@ class crm_case_section(osv.osv):
""" Model for sales teams. """
_name = "crm.case.section"
_inherits = {'mail.alias': 'alias_id'}
_inherit = "mail.thread"
_description = "Sales Teams"
_order = "complete_name"
+10 -1
View File
@@ -277,6 +277,10 @@ class crm_lead(base_stage, format_address, osv.osv):
def create(self, cr, uid, vals, context=None):
obj_id = super(crm_lead, self).create(cr, uid, vals, context)
section_id = self.browse(cr, uid, obj_id, context=context).section_id
if section_id:
followers = [follow.id for follow in section_id.message_follower_ids]
self.message_subscribe(cr, uid, [obj_id], followers, context=context)
self.create_send_note(cr, uid, [obj_id], context=context)
return obj_id
@@ -790,7 +794,12 @@ class crm_lead(base_stage, format_address, osv.osv):
stage = self.pool.get('crm.case.stage').browse(cr, uid, vals['stage_id'], context=context)
if stage.on_change:
vals['probability'] = stage.probability
return super(crm_lead,self).write(cr, uid, ids, vals, context)
if vals.get('section_id'):
section_id = self.pool.get('crm.case.section').browse(cr, uid, vals.get('section_id'), context=context)
if section_id:
vals.setdefault('message_follower_ids', [])
vals['message_follower_ids'] += [(4, follower.id) for follower in section_id.message_follower_ids]
return super(crm_lead,self).write(cr, uid, ids, vals, context)
# ----------------------------------------
# Mail Gateway
+4
View File
@@ -115,6 +115,10 @@
<field name="note"/>
</page>
</notebook>
<div class="oe_chatter">
<field name="message_ids" widget="mail_thread"/>
<field name="message_follower_ids" widget="mail_followers" help="Followers of this salesteam follow automatically all opportunities related to this salesteam."/>
</div>
</form>
</field>
</record>
+1
View File
@@ -57,6 +57,7 @@ ATTENTION:
],
'demo': [ 'document_demo.xml','board_document_demo.xml'],
'test': ['test/document_test2.yml'],
'js': ['static/src/js/document.js'],
'installable': True,
'auto_install': False,
'images': ['images/1_directories.jpeg','images/2_storage_media.jpeg','images/3_directories_structure.jpeg'],
+10
View File
@@ -0,0 +1,10 @@
openerp.document = function (instance) {
_t = instance.web._t;
instance.web.Sidebar.include({
init : function(){
this._super.apply(this, arguments);
this.sections.splice(1, 0, { 'name' : 'files', 'label' : _t('Attachment(s)'), });
this.items['files'] = [];
}
});
};
+8 -9
View File
@@ -1,15 +1,14 @@
<?xml version="1.0"?>
<openerp>
<data>
<act_window
id="act_event_list_register_event"
name="Registration"
res_model="event.registration"
src_model="event.event"
view_mode="calendar,tree,form,graph"
context="{'search_default_event_id': active_id, 'default_event_id': active_id}"
view_type="form"/>
<record id="act_event_list_register_event" model="ir.actions.act_window">
<field name="res_model">event.registration</field>
<field name="view_type">form</field>
<field name="name">Registrations</field>
<field name="view_mode">calendar,tree,form,graph</field>
<field name="context">{'search_default_event_id': active_id, 'default_event_id': active_id}</field>
</record>
<!-- Top menu item -->
<menuitem name="Events"
+1 -1
View File
@@ -3,7 +3,7 @@
<data>
<record model="ir.module.category" id="module_category_event_management">
<field name="name">Event</field>
<field name="name">Events</field>
<field name="description">Helps you manage your Events.</field>
<field name="sequence">3</field>
</record>
+2 -4
View File
@@ -350,10 +350,8 @@
<field name="arch" type="xml">
<form string="Job" version="7.0">
<header>
<span groups="base.group_user">
<button name="job_recruitement" string="In Recruitement" states="open" type="object" class="oe_highlight"/>
<button name="job_open" string="Recruitment Done" states="recruit" type="object" class="oe_highlight"/>
</span>
<button name="job_recruitement" string="In Recruitement" states="open" type="object" class="oe_highlight" groups="base.group_user"/>
<button name="job_open" string="Recruitment Done" states="recruit" type="object" class="oe_highlight" groups="base.group_user"/>
<field name="state" widget="statusbar" statusbar_visible="recruit,open"/>
</header>
<sheet>
+1 -1
View File
@@ -69,7 +69,7 @@
<field name="module_hr_timesheet_sheet" class="oe_inline"/>
<label for="module_hr_timesheet_sheet"/>
</div>
<div>
<div name="hr_attendance">
<field name="module_hr_attendance" on_change="onchange_hr_attendance(module_hr_attendance)" class="oe_inline"/>
<label for="module_hr_attendance"/>
</div>
+1
View File
@@ -22,5 +22,6 @@
import hr_attendance
import wizard
import report
import res_config
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+2 -2
View File
@@ -35,14 +35,14 @@ actions(Sign in/Sign out) performed by them.
'images': ['images/hr_attendances.jpeg'],
'depends': ['hr'],
'data': [
'security/ir_rule.xml',
'security/ir.model.access.csv',
'hr_attendance_view.xml',
'hr_attendance_report.xml',
'security/ir.model.access.csv',
'security/ir_rule.xml',
'wizard/hr_attendance_bymonth_view.xml',
'wizard/hr_attendance_byweek_view.xml',
'wizard/hr_attendance_error_view.xml',
'res_config_view.xml',
],
'demo': ['hr_attendance_demo.xml'],
'test': [
+9
View File
@@ -126,9 +126,18 @@ class hr_employee(osv.osv):
result[id] = res[0]
return result
def _attendance_access(self, cr, uid, ids, name, args, context=None):
# this function field use to hide attendance button to singin/singout from menu
group = self.pool.get('ir.model.data').get_object(cr, uid, 'base', 'group_hr_attendance')
visible = False
if uid in [user.id for user in group.users]:
visible = True
return dict([(x, visible) for x in ids])
_columns = {
'state': fields.function(_state, type='selection', selection=[('absent', 'Absent'), ('present', 'Present')], string='Attendance'),
'last_sign': fields.function(_last_sign, type='datetime', string='Last Sign'),
'attendance_access': fields.function(_attendance_access, type='boolean'),
}
def _action_check(self, cr, uid, emp_id, dt=False, context=None):
+6 -7
View File
@@ -76,9 +76,9 @@
<menuitem id="menu_hr_time_tracking" name="Time Tracking" parent="hr.menu_hr_root" sequence="5" groups="base.group_user,base.group_hr_user,base.group_hr_manager"/>
<menuitem id="menu_hr_attendance" name="Attendances" parent="hr.menu_hr_root" sequence="10" groups="base.group_user,base.group_hr_user,base.group_hr_manager"/>
<menuitem id="menu_hr_attendance" name="Attendances" parent="hr.menu_hr_root" sequence="10" groups="base.group_hr_attendance"/>
<menuitem action="open_view_attendance" id="menu_open_view_attendance" parent="menu_hr_attendance" sequence="20"/>
<menuitem action="open_view_attendance" id="menu_open_view_attendance" parent="menu_hr_attendance" sequence="20" groups="base.group_hr_attendance"/>
<record id="edit_attendance_reason" model="ir.ui.view">
<field name="name">hr.action.reason.form</field>
@@ -114,9 +114,8 @@
</record>
<menuitem
sequence="35" id="hr.menu_open_view_attendance_reason_new_config" parent="hr.menu_hr_configuration" name="Attendance"
groups="base.group_no_one"/>
<menuitem action="open_view_attendance_reason" id="menu_open_view_attendance_reason" parent="hr.menu_open_view_attendance_reason_new_config" groups="base.group_no_one"/>
sequence="35" id="hr.menu_open_view_attendance_reason_new_config" parent="hr.menu_hr_configuration" groups="base.group_hr_attendance" name="Attendance"/>
<menuitem action="open_view_attendance_reason" id="menu_open_view_attendance_reason" parent="hr.menu_open_view_attendance_reason_new_config" groups="base.group_hr_attendance"/>
<record id="hr_attendance_employee" model="ir.ui.view">
<field name="name">hr.employee.form1</field>
@@ -124,8 +123,8 @@
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<field name="active" position="before">
<label for="state"/>
<div>
<label for="state" groups="base.group_hr_attendance"/>
<div groups="base.group_hr_attendance">
<field name="state" class="oe_inline"/> -
<button class="oe_link" name="attendance_action_change" states="present" string="Sign Out" type="object" context="{'type':'sign_out'}" groups="base.group_hr_user"/>
<button class="oe_link" name="attendance_action_change" states="absent" string="Sign In" type="object" context="{'type':'sign_in'}" groups="base.group_hr_user"/>
+33
View File
@@ -0,0 +1,33 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from osv import fields, osv
class hr_attendance_config_settings(osv.osv_memory):
_inherit = 'hr.config.settings'
_columns = {
'group_hr_attendance': fields.boolean('Track attendances',
implied_group='base.group_hr_attendance',
help="Allocates attendance group to all users."),
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+20
View File
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<record id="hr_attendace_group" model="ir.ui.view">
<field name="name">hr.config.settings.inherit</field>
<field name="model">hr.config.settings</field>
<field name="inherit_id" ref="hr.view_human_resources_configuration"/>
<field name="arch" type="xml">
<data>
<xpath expr="//div[@name='hr_attendance']" position="after">
<div>
<field name="group_hr_attendance" class="oe_inline"/>
<label for="group_hr_attendance"/>
</div>
</xpath>
</data>
</field>
</record>
</data>
</openerp>
@@ -2,6 +2,11 @@
<openerp>
<data noupdate="True">
<record id="base.group_hr_attendance" model="res.groups">
<field name="name">Attendances</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>
<record id="property_rule_attendace_manager" model="ir.rule">
<field name="name">Manager Attendance</field>
<field model="ir.model" name="model_id" ref="model_hr_attendance"/>
@@ -57,9 +57,12 @@ openerp.hr_attendance = function (instance) {
var employee = new instance.web.DataSetSearch(self, 'hr.employee', self.session.user_context, [
['user_id', '=', self.session.uid]
]);
return employee.read_slice(['id', 'name', 'state', 'last_sign']).pipe(function (res) {
if (_.isEmpty(res))
return employee.read_slice(['id', 'name', 'state', 'last_sign', 'attendance_access']).pipe(function (res) {
if (_.isEmpty(res) )
return;
if (res[0].attendance_access == false){
return;
}
self.$el.show();
self.employee = res[0];
self.last_sign = instance.web.str_to_datetime(self.employee.last_sign);
+7 -7
View File
@@ -5,13 +5,13 @@
<!-- Contracts Button on Employee Form -->
<act_window
context="{'search_default_employee_id': [active_id], 'default_employee_id': active_id}"
id="act_hr_employee_2_hr_contract"
name="Contracts"
res_model="hr.contract"
src_model="hr.employee"
groups="base.group_hr_manager"/>
<record id="act_hr_employee_2_hr_contract" model="ir.actions.act_window">
<field name="res_model">hr.contract</field>
<field name="view_type">form</field>
<field name="name">Contracts</field>
<field name="view_mode">tree,form</field>
<field name="context">{'search_default_employee_id': [active_id], 'default_employee_id': active_id}</field>
</record>
<menuitem id="next_id_56" name="Contract" parent="hr.menu_hr_configuration" sequence="30" groups="base.group_no_one"/>
<record id="hr_hr_employee_view_form2" model="ir.ui.view">
+9 -2
View File
@@ -141,6 +141,7 @@ hr_employee()
class hr_evaluation(osv.osv):
_name = "hr_evaluation.evaluation"
_inherit = "mail.thread"
_description = "Employee Appraisal"
_rec_name = 'employee_id'
_columns = {
@@ -242,8 +243,10 @@ class hr_evaluation(osv.osv):
def button_final_validation(self, cr, uid, ids, context=None):
request_obj = self.pool.get('hr.evaluation.interview')
self.write(cr, uid, ids, {'state':'progress'}, context=context)
for id in self.browse(cr, uid, ids, context=context):
if len(id.survey_request_ids) != len(request_obj.search(cr, uid, [('evaluation_id', '=', id.id),('state', 'in', ['done','cancel'])], context=context)):
for evaluation in self.browse(cr, uid, ids, context=context):
if evaluation.employee_id and evaluation.employee_id.parent_id and evaluation.employee_id.parent_id.user_id:
self.message_subscribe_users(cr, uid, [evaluation.id], user_ids=[evaluation.employee_id.parent_id.user_id.id], context=context)
if len(evaluation.survey_request_ids) != len(request_obj.search(cr, uid, [('evaluation_id', '=', evaluation.id),('state', 'in', ['done','cancel'])], context=context)):
raise osv.except_osv(_('Warning!'),_("You cannot change state, because some appraisal(s) are in waiting answer or draft state."))
return True
@@ -263,6 +266,10 @@ class hr_evaluation(osv.osv):
return True
def write(self, cr, uid, ids, vals, context=None):
if vals.get('employee_id'):
employee_id = self.pool.get('hr.employee').browse(cr, uid, vals.get('employee_id'), context=context)
if employee_id.parent_id and employee_id.parent_id.user_id:
vals['message_follower_ids'] = [(4, employee_id.parent_id.user_id.partner_id.id)]
if 'date' in vals:
new_vals = {'date_deadline': vals.get('date')}
obj_hr_eval_iterview = self.pool.get('hr.evaluation.interview')
+17 -8
View File
@@ -58,6 +58,16 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<!-- Appraisal Interviews Action -->
<record id="act_hr_employee_2_hr__evaluation_interview" model="ir.actions.act_window">
<field name="res_model">hr.evaluation.interview</field>
<field name="view_type">form</field>
<field name="name">Interviews</field>
<field name="view_mode">tree,form</field>
<field name="context">{'search_default_user_to_review_id': [active_id], 'default_user_to_review_id': active_id}</field>
</record>
<menuitem name="Appraisal" parent="hr.menu_hr_root" id="menu_eval_hr" sequence="25"/>
<menuitem name="Periodic Appraisal" parent="hr.menu_hr_configuration" id="menu_eval_hr_config" sequence="4"/>
@@ -134,6 +144,9 @@
<field name="evaluation_date"/>
</group>
</xpath>
<xpath expr="//div[@name='button_box']" position="inside">
<button name="%(act_hr_employee_2_hr__evaluation_interview)d" string="Appraisal Interviews" type="action"/>
</xpath>
</field>
</record>
@@ -196,6 +209,10 @@
<field nolabel="1" name="note_summary" placeholder="Action Plan..."/>
</group>
</sheet>
<div class="oe_chatter">
<field name="message_ids" widget="mail_thread"/>
<field name="message_follower_ids" widget="mail_followers"/>
</div>
</form>
</field>
</record>
@@ -408,13 +425,5 @@
'default_body_text': 'Hello,\n\nKindly post your response for the survey interview.\n\nThanks',
'default_subject': 'Reminder to fill up Survey'}"/>
<!-- Appraisal Interviews Button on Employee Form -->
<act_window
context="{'search_default_user_to_review_id': [active_id], 'default_user_to_review_id': active_id}"
id="act_hr_employee_2_hr__evaluation_interview"
name="Appraisal Interviews"
res_model="hr.evaluation.interview"
src_model="hr.employee"/>
</data>
</openerp>
+3
View File
@@ -118,6 +118,9 @@ class hr_expense_expense(osv.osv):
return {'value': {'department_id': department_id, 'company_id': company_id}}
def expense_confirm(self, cr, uid, ids, *args):
for expense in self.browse(cr, uid, ids):
if expense.employee_id and expense.employee_id.parent_id.user_id:
self.message_subscribe_users(cr, uid, [expense.id], user_ids=[expense.employee_id.parent_id.user_id.id])
self.write(cr, uid, ids, {
'state':'confirm',
'date_confirm': time.strftime('%Y-%m-%d')
+2 -4
View File
@@ -195,12 +195,10 @@
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml">
<field name="purchase_ok" position="before">
<div>
<field name="purchase_ok" position="before">
<field name="hr_expense_ok" on_change="on_change_hr_expense_ok(hr_expense_ok)"/>
<label for="hr_expense_ok"/>
</div>
</field>
</field>
</field>
</record>
+1 -1
View File
@@ -303,7 +303,7 @@ class hr_holidays(osv.osv):
self.check_holidays(cr, uid, ids, context=context)
for record in self.browse(cr, uid, ids, context=context):
if record.employee_id and record.employee_id.parent_id and record.employee_id.parent_id.user_id:
self.message_subscribe(cr, uid, [record.id], user_ids=[record.employee_id.parent_id.user_id.id], context=context)
self.message_subscribe_users(cr, uid, [record.id], user_ids=[record.employee_id.parent_id.user_id.id], context=context)
self.holidays_confirm_notificate(cr, uid, ids, context=context)
return self.write(cr, uid, ids, {'state':'confirm'})
+10 -8
View File
@@ -369,14 +369,16 @@
<field name="view_id" ref="view_hr_payslip_tree"/>
<field name="search_view_id" ref="view_hr_payslip_filter"/>
</record>
<menuitem action="action_view_hr_payslip_form" id="menu_department_tree" parent="menu_hr_root_payroll" groups="base.group_hr_user"/>
<act_window name="Payslips"
context="{'search_default_employee_id': [active_id], 'default_employee_id': active_id}"
res_model="hr.payslip"
src_model="hr.employee"
view_id ="view_hr_payslip_tree"
id="act_hr_employee_payslip_list"
groups="base.group_hr_manager"/>
<menuitem action="action_view_hr_payslip_form" id="menu_department_tree" parent="menu_hr_root_payroll" groups="base.group_hr_user"/>
<record id="act_hr_employee_payslip_list" model="ir.actions.act_window">
<field name="res_model">hr.payslip</field>
<field name="name">Payslips</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="context">{'search_default_employee_id': [active_id], 'default_employee_id': active_id}</field>
</record>
<!-- Employee View -->
<record id="payroll_hr_employee_view_form" model="ir.ui.view">
@@ -347,18 +347,11 @@
src_model="res.users"/>
<act_window
context="{'search_default_account_id': [active_id],'default_account_id': [active_id]}"
id="act_account_analytic_account_2_report_timehsheet_account"
name="Timesheets"
res_model="hr.analytic.timesheet"
src_model="account.analytic.account"/>
<act_window
context="{'search_default_manager_id': [active_id]}"
id="act_res_users_2_report_timesheet_invoice"
name="Costs to invoice"
res_model="report_timesheet.invoice"
src_model="res.users"/>
context="{'search_default_manager_id': [active_id]}"
id="act_res_users_2_report_timesheet_invoice"
name="Costs to invoice"
res_model="report_timesheet.invoice"
src_model="res.users"/>
</data>
@@ -103,6 +103,7 @@ class one2many_mod(fields.one2many):
class hr_timesheet_sheet(osv.osv):
_name = "hr_timesheet_sheet.sheet"
_inherit = "mail.thread"
_table = 'hr_timesheet_sheet_sheet'
_order = "id desc"
_description="Timesheet"
@@ -265,6 +266,8 @@ class hr_timesheet_sheet(osv.osv):
def button_confirm(self, cr, uid, ids, context=None):
for sheet in self.browse(cr, uid, ids, context=context):
if sheet.employee_id and sheet.employee_id.parent_id and sheet.employee_id.parent_id.user_id:
self.message_subscribe_users(cr, uid, [sheet.id], user_ids=[sheet.employee_id.parent_id.user_id.id], context=context)
self.check_employee_attendance_state(cr, uid, sheet.id, context=context)
di = sheet.user_id.company_id.timesheet_max_difference
if (abs(sheet.total_difference) < di) or not di:
@@ -64,9 +64,9 @@
<field name="company_id" groups="base.group_multi_company"/>
</group>
<group>
<field name="total_attendance" widget="float_time"/>
<field name="total_attendance" widget="float_time" groups="base.group_hr_attendance"/>
<field name="total_timesheet" widget="float_time"/>
<field name="total_difference" widget="float_time"/>
<field name="total_difference" widget="float_time" groups="base.group_hr_attendance"/>
<field name="user_id" invisible="1"/>
</group>
</group>
@@ -84,7 +84,7 @@
</div>
</group>
<group colspan="4" col="3">
<field context="{'name':date_current,'user_id':user_id}" name="attendances_ids" nolabel="1">
<field context="{'name':date_current,'user_id':user_id}" name="attendances_ids" nolabel="1" groups="base.group_hr_attendance">
<tree string="Attendances" editable="bottom">
<field name="name"/>
<field name="action"/>
@@ -92,14 +92,14 @@
</tree>
</field>
<group>
<div align="right" groups="base.group_hr_manager">
<button name="attendance_action_change" attrs="{'invisible': [('state_attendance', '=', 'present')]}" type="object" string="Sign In"/>
<button name="attendance_action_change" attrs="{'invisible': ['|', ('state_attendance','=',False), ('state_attendance', '=', 'absent')]}" type="object" string="Sign Out"/>
<div align="right" groups="base.group_hr_manager,base.group_hr_attendance">
<button name="attendance_action_change" attrs="{'invisible': [('state_attendance', '=', 'present')]}" type="object" string="Sign In" groups="base.group_hr_attendance"/>
<button name="attendance_action_change" attrs="{'invisible': ['|', ('state_attendance','=',False), ('state_attendance', '=', 'absent')]}" type="object" string="Sign Out" groups="base.group_hr_attendance"/>
</div>
</group>
</group>
<group col="4">
<field name="state_attendance"/>
<field name="state_attendance" groups="base.group_hr_attendance"/>
</group>
<field colspan="4" context="{'date':date_current,'user_id':user_id}" domain="[('name','=',date_current)]" name="timesheet_ids" nolabel="1">
<tree editable="top" string="Timesheet Lines">
@@ -134,14 +134,18 @@
<field colspan="4" name="period_ids" nolabel="1">
<tree colors="red:total_difference&lt;0.1;blue:total_difference&gt;=0.1" string="Period">
<field name="name"/>
<field name="total_attendance" widget="float_time"/>
<field name="total_attendance" widget="float_time" groups="base.group_hr_attendance"/>
<field name="total_timesheet" widget="float_time"/>
<field name="total_difference" widget="float_time"/>
<field name="total_difference" widget="float_time" groups="base.group_hr_attendance"/>
</tree>
</field>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_ids" colspan="4" widget="mail_thread" nolabel="1"/>
<field name="message_follower_ids" widget="mail_followers"/>
</div>
</form>
</field>
</record>
@@ -318,9 +322,9 @@
<field name="date_from"/>
<field name="date_to"/>
<field name="department_id"/>
<field name="total_attendance" widget="float_time"/>
<field name="total_attendance" widget="float_time" groups="base.group_hr_attendance"/>
<field name="total_timesheet" widget="float_time"/>
<field name="total_difference" widget="float_time"/>
<field name="total_difference" widget="float_time" groups="base.group_hr_attendance"/>
<field name="state"/>
</tree>
</field>
@@ -332,18 +336,23 @@
<field name="arch" type="xml">
<tree colors="blue:total_difference&lt;0.1;red:total_difference&gt;=0.1" string="Period">
<field name="name"/>
<field name="total_attendance" widget="float_time" sum="Total Attendances"/>
<field name="total_attendance" widget="float_time" sum="Total Attendances" groups="base.group_hr_attendance"/>
<field name="total_timesheet" widget="float_time" sum="Total Timesheet"/>
<field name="total_difference" widget="float_time" sum="Total Difference"/>
<field name="total_difference" widget="float_time" sum="Total Difference" groups="base.group_hr_attendance"/>
</tree>
</field>
</record>
<!-- Timesheet Button on Employee Form -->
<act_window
context="{'search_default_employee_id': [active_id], 'default_employee_id': active_id}"
id="act_hr_employee_2_hr_timesheet" name="Timesheets" res_model="hr_timesheet_sheet.sheet" src_model="hr.employee"/>
<record id="act_hr_employee_2_hr_timesheet" model="ir.actions.act_window">
<field name="res_model">hr_timesheet_sheet.sheet</field>
<field name="view_type">form</field>
<field name="name">Timesheets</field>
<field name="view_mode">tree,form</field>
<field name="context">{'search_default_employee_id': [active_id], 'default_employee_id': active_id}</field>
</record>
<record id="hr_timesheet_sheet_employee_extd_form" model="ir.ui.view">
<field name="name">hr.timesheet.sheet.employee.extd_form</field>
<field name="model">hr.employee</field>
@@ -33,7 +33,7 @@
<act_window id="action_lunch_order_cancel_values"
key2="client_action_multi" name="Cancel Order"
res_model="lunch.order.cancel" src_model="lunch.order"
view_mode="form" target="new" view_type="form"/>
view_mode="form" target="new" view_type="form" multi="True"/>
</data>
</openerp>
@@ -34,7 +34,7 @@
<act_window id="action_lunch_order_confirm_values"
key2="client_action_multi" name="Confirm Order"
res_model="lunch.order.confirm" src_model="lunch.order"
view_mode="form" target="new" view_type="form"/>
view_mode="form" target="new" view_type="form" multi="True"/>
</data>
</openerp>
+1 -1
View File
@@ -4,7 +4,7 @@
<!-- CATEGORY -->
<record model="ir.module.category" id="module_category_social">
<field name="name">Social and Sharing Tools</field>
<field name="name">Home</field>
<field name="parent_id" ref="base.module_category_tools"/>
<field name="sequence">26</field>
</record>
@@ -26,6 +26,8 @@ openerp_mail_followers = function(session, mail) {
this._super.apply(this, arguments);
this.options.image = this.node.attrs.image || 'image_small';
this.options.title = this.node.attrs.title || 'Followers';
this.options.context = this.node.attrs.context;
this.options.comment = this.node.attrs.help || false;
this.ds_model = new session.web.DataSetSearch(this, this.view.model);
this.ds_follow = new session.web.DataSetSearch(this, this.field.relation);
},
@@ -11,6 +11,11 @@
<button type="button" class="oe_mail_button_follow">Follow</button>
<button type="button" class="oe_mail_button_unfollow oe_mail_button_mouseout">Following</button>
</div>
<div class="oe_grey">
<t t-if="widget.options.comment">
<h5><t t-raw="widget.options.comment"/></h5>
</t>
</div>
<div class="oe_mail_recthread_followers">
<t t-if="widget.options.title">
<h4><t t-raw="widget.options.title"/></h4>
@@ -5,21 +5,36 @@
<menuitem name="Configuration" id="menu_marketing_configuration" parent="base.marketing_menu" sequence="1"/>
<!-- Marketing Campaign -->
<act_window name="All Segments"
res_model="marketing.campaign.segment"
src_model="marketing.campaign"
view_type="form"
view_mode="tree,form"
id="act_marketing_campaing_segment_opened"
context="{'search_default_campaign_id': [active_id], 'default_campaign_id': active_id}"/>
<record id="act_marketing_campaing_segment_opened" model="ir.actions.act_window">
<field name="res_model">marketing.campaign.segment</field>
<field name="view_type">form</field>
<field name="name">Segments</field>
<field name="view_mode">tree,form</field>
<field name="context">{'search_default_campaign_id': [active_id], 'default_campaign_id': active_id}</field>
</record>
<!-- Campaign Follow-ups -->
<record id="act_marketing_campaing_followup" model="ir.actions.act_window">
<field name="res_model">marketing.campaign.workitem</field>
<field name="view_type">form</field>
<field name="name">Workitems</field>
<field name="view_mode">tree,form</field>
<field name="context">{'search_default_campaign_id': [active_id], 'default_campaign_id': active_id}</field>
</record>
<!-- Campaign Statistics -->
<record id="act_marketing_campaing_stat" model="ir.actions.act_window" >
<field name="res_model">campaign.analysis</field>
<field name="view_type">form</field>
<field name="name">Campaign Follow-up</field>
<field name="view_mode">tree,form</field>
<field name="context">{'search_default_campaign_id': [active_id], 'default_campaign_id': active_id}</field>
</record>
<!-- Campaign Followups -->
<act_window
context="{'search_default_campaign_id': [active_id], 'default_campaign_id': active_id}"
id="act_marketing_campaing_followup"
name="Campaign Follow-up" res_model="marketing.campaign.workitem"
src_model="marketing.campaign" view_mode="tree,form"
view_type="form"/>
<record model="ir.ui.view" id="view_marketing_campaign_form">
<field name="name">marketing.campaign.form</field>
@@ -35,12 +50,15 @@
</header>
<sheet string="Campaign">
<div class="oe_right oe_button_box" name="button_box">
<button type="action"
<button type="action"
name="%(act_marketing_campaing_stat)d"
string="Campaign Statistics"/>
<button type="action"
name="%(act_marketing_campaing_segment_opened)d"
string="Segments"/>
<button type="action"
name="%(act_marketing_campaing_followup)d"
string="Follow-Up"/>
<button type="action"
name="%(act_marketing_campaing_segment_opened)d"
string="Segments"/>
</div>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
@@ -422,29 +440,5 @@
<menuitem id="menu_action_marketing_campaign_workitem" parent="menu_marketing_campaign" action="action_marketing_campaign_workitem" sequence="10"/>
<act_window name="All Segments"
res_model="marketing.campaign.segment"
src_model="marketing.campaign"
view_type="form"
view_mode="tree,form"
id="act_marketing_campaing_segment_opened"
context="{'search_default_campaign_id': [active_id], 'default_campaign_id': active_id}"/>
<!-- Campaign Follow-ups -->
<act_window
context="{'search_default_campaign_id': [active_id], 'default_campaign_id': active_id}"
id="act_marketing_campaing_followup"
name="Campaign Follow-up" res_model="marketing.campaign.workitem"
src_model="marketing.campaign" view_mode="tree,form"
view_type="form"/>
<!-- Campaign Statistics -->
<act_window
context="{'search_default_campaign_id': [active_id], 'default_campaign_id': active_id}"
id="act_marketing_campaing_stat"
name="Campaign Statistics" res_model="campaign.analysis"
src_model="marketing.campaign" view_mode="tree,form"
view_type="form"/>
</data>
</openerp>
+2 -1
View File
@@ -461,7 +461,8 @@ class mrp_production(osv.osv):
'date_start': fields.datetime('Start Date', select=True, readonly=True),
'date_finished': fields.datetime('End Date', select=True, readonly=True),
'bom_id': fields.many2one('mrp.bom', 'Bill of Material', domain=[('bom_id','=',False)], readonly=True, states={'draft':[('readonly',False)]}),
'bom_id': fields.many2one('mrp.bom', 'Bill of Material', domain=[('bom_id','=',False)], readonly=True, states={'draft':[('readonly',False)]},
help="Bill of Materials allow you to define the list of required raw materials to make a finished product."),
'routing_id': fields.many2one('mrp.routing', string='Routing', on_delete='set null', readonly=True, states={'draft':[('readonly',False)]},
help="The list of operations (list of work centers) to produce the finished product. The routing is mainly used to compute work center costs during operations and to plan future loads on work centers based on production plannification."),
'picking_id': fields.many2one('stock.picking', 'Picking List', readonly=True, ondelete="restrict",
+15 -3
View File
@@ -13,7 +13,7 @@
parent="base.menu_mrp_root"
sequence="1"/>
<menuitem name="Master Data"
<menuitem name="Products"
id="menu_mrp_bom"
parent="base.menu_mrp_root"
sequence="5"/>
@@ -513,7 +513,15 @@
</p>
</field>
</record>
<record id="product_supply_method_produce" model="ir.actions.act_window">
<field name="name">Products</field>
<field name="res_model">product.product</field>
<field name="view_type">form</field>
<field name="view_mode">kanban,tree,form</field>
<field name="context">{'search_default_filter_supply_method_produce' : 1}</field>
<field name="search_view_id" ref="product.product_search_form_view"/>
</record>
<!-- BOM menus -->
<menuitem
@@ -521,6 +529,10 @@
id="menu_mrp_bom_form_action"
parent="menu_mrp_bom"
sequence="10"/>
<menuitem name="Products"
id="menu_mrp_product_form"
action="product_supply_method_produce"
parent="menu_mrp_bom"/>
<menuitem
action="mrp_bom_form_action2"
id="menu_mrp_bom_form_action2"
@@ -644,7 +656,7 @@
<field name="date_planned"/>
</group>
<group>
<field name="bom_id" domain="[('product_id','=',product_id)]" context="{'default_product_id': product_id}" on_change="bom_id_change(bom_id)"/>
<field name="bom_id" domain="[('product_id','=',product_id)]" context="{'default_product_id': product_id}" on_change="bom_id_change(bom_id)" required="1"/>
<field name="routing_id" class="oe_inline" groups="mrp.group_mrp_routings"/>
<field name="user_id"/>
<field name="origin"/>
@@ -27,7 +27,8 @@
view_mode="form"
target="new"
key2="client_action_multi"
id="act_mrp_repair_invoice"/>
id="act_mrp_repair_invoice"
multi="True"/>
</data>
</openerp>
+2 -2
View File
@@ -1,2 +1,2 @@
id,name,implied_ids/id
group_note_fancy,Memo / Fancy mode,
id,name,implied_ids/id,category_id/id
group_note_fancy,Notes / Fancy mode,,base.module_category_hidden
1 id name implied_ids/id category_id/id
2 group_note_fancy Memo / Fancy mode Notes / Fancy mode base.module_category_hidden
+44 -20
View File
@@ -1,17 +1,36 @@
.oe_pad_head {
box-sizing: border-box;
width: 100%;
display: block;
padding: 4px;
text-align: right;
}
.oe_pad_head .oe_pad_switch {
.oe_pad {
margin-top: 16px;
}
.oe_pad_readonly {
border: 1px solid #ddd;
padding: 8px;
.oe_pad_switch_positioner {
position: relative;
}
.oe_pad_switch {
position: absolute;
top: 5px;
left: 383px;
width: 28px;
height: 28px;
background-image: -webkit-linear-gradient(top, white, #f0f0f0);
border: solid 1px #ccc;
border-radius:3px;
text-align: center;
line-height: 22px;
overflow: hidden;
-webkit-box-sizing: border-box;
color: #666666;
padding-top:-3px;
padding-left:-1px;
cursor: pointer;
}
.oe_pad_switch:hover{
background-image: -webkit-linear-gradient(top, #f4f4f4, #e4e4e4);
}
.oe_pad_fullscreen .oe_pad_switch {
top:4px;
}
.oe_pad_fullscreen {
@@ -27,9 +46,9 @@
z-index: 1000;
}
.oe_pad_content {
.oe_pad.oe_configured .oe_pad_content.oe_editing{
border: solid 1px #c4c4c4;
height: 150px;
height:300px;
-webkit-box-shadow: 0 5px 10px rgba(0,0,0,0.1);
-moz-box-shadow: 0 5px 10px rgba(0,0,0,0.1);
-ms-box-shadow: 0 5px 10px rgba(0,0,0,0.1);
@@ -37,12 +56,7 @@
box-shadow: 0 5px 10px rgba(0,0,0,0.1);
}
.oe_pad_content > p {
text-align: center;
opacity: 0.75;
}
.oe_pad_fullscreen .oe_pad_content {
.oe_pad.oe_configured.oe_pad_fullscreen .oe_pad_content {
height: 100%;
border: none;
-webkit-box-shadow: none;
@@ -52,6 +66,16 @@
box-shadow: none;
}
.oe_pad.oe_unconfigured > p {
text-align: center;
opacity: 0.75;
}
.oe_pad_loading{
text-align: center;
opacity: 0.75;
}
.etherpad_readonly ul, .etherpad_readonly ol {
margin-before: 1em;
margin-after: 1em;
+55 -56
View File
@@ -1,62 +1,61 @@
openerp.pad = function(instance) {
instance.web.form.FieldPad = instance.web.form.AbstractField.extend({
template: 'FieldPad',
configured: false,
content: "",
set_value: function(val) {
var self = this;
var _super = self._super;
_super.apply(self,[val]);
instance.web.form.FieldPad = instance.web.form.AbstractField.extend({
template: 'FieldPad',
start: function() {
this._super();
var self = this;
this.$el.find('div.oe_pad_head').click(function(ev) {
self.$el.toggleClass('oe_pad_fullscreen');
});
this.on("change:effective_readonly", this, function() {
this.render_value();
});
},
set_value: function(val) {
var self = this;
var _super = self._super;
_super.apply(self,[val]);
if (val === false || val === "") {
self.field_manager.dataset.call('pad_generate_url',{context:{
model: self.field_manager.model,
field_name: self.name,
object_id: self.field_manager.datarecord.id
}}).then(function(data) {
if(data&&data.url){
_super.apply(self,[data.url]);
self.render_value();
}
});
} else {
self.render_value();
}
this._dirty_flag = true;
},
render_value: function() {
var self = this;
var value = this.get('value');
if (!_.str.startsWith(value, "http")) {
self.$('.oe_pad_content').html(instance.web.qweb.render('FieldPad.unconfigured'));
} else {
if (!this.get("effective_readonly")) {
var pad_username = this.session.username;
var code = '<iframe width="100%" height="100%" frameborder="0" src="'+value+'?showChat=false&userName='+pad_username+'"></iframe>';
this.$('.oe_pad_content').html(code);
} else {
$.get(value+'/export/html').success(function(data) {
self.$('.oe_pad_content').html('<div class="oe_pad_readonly">'+data+'</div>');
}).error(function() {
self.$('.oe_pad_content').text('Unable to load pad');
if (val === false || val === "") {
self.field_manager.dataset.call('pad_generate_url',{context:{
model: self.field_manager.model,
field_name: self.name,
object_id: self.field_manager.datarecord.id
}}).then(function(data) {
if(data&&data.url){
_super.apply(self,[data.url]);
self.renderElement();
}
});
} else {
self.renderElement();
}
}
},
});
instance.web.form.widgets = instance.web.form.widgets.extend({
'pad': 'instance.web.form.FieldPad',
});
this._dirty_flag = true;
},
renderElement: function(){
var self = this;
var value = this.get('value');
if(!_.str.startsWith(value,'http')){
this.configured = false;
this.content = "";
}else{
this.configured = true;
if(!this.get('effective_readonly')){
this.content = '<iframe width="100%" height="100%" frameborder="0" src="'+value+'?showChat=false&userName='+this.session.username+'"></iframe>';
}else{
this.content = '<div class="oe_pad_loading">... Loading pad ...</div>';
$.get(value+'/export/html').success(function(data){
self.$('.oe_pad_content').html('<div class="oe_pad_readonly">'+data+'<div>');
}).error(function(){
self.$('.oe_pad_content').text('Unable to load pad');
});
}
}
this._super();
this.$('.oe_pad_content').html(this.content);
this.$('.oe_pad_switch').click(function(){
self.$el.toggleClass('oe_pad_fullscreen');
});
this.on('change:effective_readonly',this,function(){
self.renderElement();
});
},
});
instance.web.form.widgets = instance.web.form.widgets.extend({
'pad': 'instance.web.form.FieldPad',
});
};
+31 -13
View File
@@ -2,17 +2,35 @@
<!-- vim:fdl=1:
-->
<templates id="template" xml:space="preserve">
<t t-name="FieldPad">
<div class="oe_form_field_text oe_pad">
<div class="oe_pad_head">
<button class="oe_pad_switch oe_button">Fullscreen</button>
</div>
<div class="oe_pad_content"></div>
</div>
</t>
<t t-name="FieldPad.unconfigured">
<p>
You must configure the etherpad through the menu Setting > Companies > Companies, in the configuration tab of your company.<br/>
</p>
</t>
<t t-name="FieldPad">
<t t-if="!widget.configured">
<div class="oe_form_field_text oe_pad oe_unconfigured">
<p>
You must configure the etherpad through the menu Setting > Companies > Companies, in the configuration tab of your company.
</p>
</div>
</t>
<t t-if="widget.configured">
<t t-if="widget.get('effective_readonly')">
<div class="oe_form_field_text oe_pad oe_configured">
<div class="oe_pad_content etherpad_readonly">
</div>
</div>
</t>
<t t-if="!widget.get('effective_readonly')">
<div class="oe_form_field_text oe_pad oe_configured">
<div class="oe_pad_switch_positioner">
<span class="oe_pad_switch oe_e">&amp;Ntilde;</span>
</div>
<div class="oe_pad_content oe_editing">
</div>
</div>
</t>
</t>
</t>
</templates>
+7
View File
@@ -1100,6 +1100,10 @@ class task(base_stage, osv.osv):
def create(self, cr, uid, vals, context=None):
task_id = super(task, self).create(cr, uid, vals, context=context)
project_id = self.browse(cr, uid, task_id, context=context).project_id
if project_id:
followers = [follower.id for follower in project_id.message_follower_ids]
self.message_subscribe(cr, uid, [task_id], followers, context=context)
self._store_history(cr, uid, [task_id], context=context)
self.create_send_note(cr, uid, [task_id], context=context)
return task_id
@@ -1109,6 +1113,9 @@ class task(base_stage, osv.osv):
def write(self, cr, uid, ids, vals, context=None):
if isinstance(ids, (int, long)):
ids = [ids]
if vals.get('project_id'):
project_id = self.pool.get('project.project').browse(cr, uid, vals.get('project_id'), context=context)
vals['message_follower_ids'] = [(4, follower.id) for follower in project_id.message_follower_ids]
if vals and not 'kanban_state' in vals and 'stage_id' in vals:
new_stage = vals.get('stage_id')
vals_reset_kstate = dict(vals, kanban_state='normal')
+9 -19
View File
@@ -10,15 +10,14 @@
<menuitem id="menu_project_management" name="Project" parent="base.menu_main_pm" sequence="1"/>
<menuitem id="base.menu_definitions" name="Configuration" parent="base.menu_main_pm" sequence="60"/>
<act_window
context="{'search_default_project_id': [active_id], 'default_project_id': active_id}"
id="act_project_project_2_project_task_all"
name="Tasks"
res_model="project.task"
src_model="project.project"
view_mode="kanban,tree,form,calendar,graph"
view_type="form"/>
<record id="act_project_project_2_project_task_all" model="ir.actions.act_window">
<field name="res_model">project.task</field>
<field name="view_type">form</field>
<field name="name">Tasks</field>
<field name="view_mode">kanban,tree,form,calendar,graph</field>
<field name="context">{'search_default_project_id': [active_id], 'default_project_id': active_id}</field>
</record>
<!-- Project Read/Unread actions -->
<record id="actions_server_project_unread" model="ir.actions.server">
@@ -153,7 +152,7 @@
</sheet>
<div class="oe_chatter">
<field name="message_ids" widget="mail_thread"/>
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_follower_ids" widget="mail_followers" help="Follow this project to automatically follow all related tasks and issues."/>
</div>
</form>
</field>
@@ -207,15 +206,6 @@
</field>
</record>
<act_window
context="{'search_default_project_id': active_id, 'default_project_id': active_id}"
id="act_project_project_2_project_task_all"
name="Tasks"
res_model="project.task"
src_model="project.project"
view_mode="kanban,tree,form,calendar,graph"
view_type="form"/>
<record model="ir.ui.view" id="view_project_kanban">
<field name="name">project.project.kanban</field>
<field name="model">project.project</field>
+8
View File
@@ -364,6 +364,10 @@ class project_issue(base_stage, osv.osv):
logged_fields = ['stage_id', 'state', 'message_ids']
if any([field in vals for field in logged_fields]):
vals['date_action_last'] = time.strftime('%Y-%m-%d %H:%M:%S')
if vals.get('project_id'):
project_id = self.pool.get('project.project').browse(cr, uid, vals.get('project_id'), context=context)
vals['message_follower_ids'] = [(4, follower.id) for follower in project_id.message_follower_ids]
return super(project_issue, self).write(cr, uid, ids, vals, context)
def onchange_task_id(self, cr, uid, ids, task_id, context=None):
@@ -381,6 +385,10 @@ class project_issue(base_stage, osv.osv):
def create(self, cr, uid, vals, context=None):
obj_id = super(project_issue, self).create(cr, uid, vals, context=context)
project_id = self.browse(cr, uid, obj_id, context=context).project_id
if project_id:
followers = [follower.id for follower in project_id.message_follower_ids]
self.message_subscribe(cr, uid, [obj_id], followers, context=context)
self.create_send_note(cr, uid, [obj_id], context=context)
return obj_id
+7 -7
View File
@@ -340,13 +340,13 @@
</field>
</record>
<act_window id="act_project_project_2_project_issue_all"
name="Issues"
src_model="project.project"
res_model="project.issue"
view_type="form"
view_mode="kanban,tree,form,calendar,graph"
context="{'search_default_project_id': [active_id], 'default_project_id': active_id}"/>
<record id="act_project_project_2_project_issue_all" model="ir.actions.act_window">
<field name="res_model">project.issue</field>
<field name="view_type">form</field>
<field name="name">Issues</field>
<field name="view_mode">kanban,tree,form,calendar,graph</field>
<field name="context">{'search_default_project_id': [active_id], 'default_project_id': active_id}</field>
</record>
<!-- Project -->
<record id="view_project_form_inherited" model="ir.ui.view">
@@ -83,13 +83,14 @@
<!-- Project Phase -->
<act_window id="act_project_phases"
name="Phases"
src_model="project.project"
res_model="project.phase"
view_type="form"
view_mode="tree,form"
context="{'search_default_project_id': [active_id], 'default_project_id': active_id}"/>
<record id="act_project_phases" model="ir.actions.act_window">
<field name="res_model">project.phase</field>
<field name="view_type">form</field>
<field name="name">Phases</field>
<field name="view_mode">tree,form</field>
<field name="context">{'search_default_project_id': [active_id], 'default_project_id': active_id}</field>
</record>
<record id="project_phase_form" model="ir.ui.view">
<field name="name">Inherit project form : Phase</field>
@@ -123,6 +124,14 @@
</xpath>
</field>
</record>
<record id="project_phase_task_list" model="ir.actions.act_window">
<field name="res_model">project.task</field>
<field name="view_type">form</field>
<field name="name">Tasks</field>
<field name="view_mode">tree,form</field>
<field name="context">{'search_default_phase_id': [active_id], 'default_phase_id' : active_id}</field>
</record>
<record id="view_project_phase_form" model="ir.ui.view">
<field name="name">project.phase.form</field>
@@ -138,6 +147,7 @@
<field name="state" widget="statusbar" statusbar_visible="draft,open,done" statusbar_colors='{"pending":"blue"}'/>
</header>
<sheet>
<button name="%(project_phase_task_list)d" string="Related Tasks" type="action" class="oe_right"/>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1><field name="name"/></h1>
@@ -336,14 +346,6 @@
</field>
</record>
<act_window
context="{'search_default_phase_id': [active_id], 'default_phase_id' : active_id}"
id="project_phase_task_list"
name="Related Tasks"
res_model="project.task"
src_model="project.phase"
view_mode="tree,form"/>
<record id="analytic_account_inherited_phase_form" model="ir.ui.view">
<field name="name">account.analytic.account.phase.form.inherit</field>
<field name="model">account.analytic.account</field>
@@ -97,7 +97,7 @@
<menuitem action="hr_timesheet.action_hr_timesheet_sign_in"
id="menu_hr_timesheet_sign_in"
parent="hr_attendance.menu_hr_attendance"
sequence="5" />
sequence="5" groups="base.group_hr_attendance" />
<menuitem id="menu_project_billing" name="Invoicing"
parent="base.menu_main_pm" sequence="5"/>
+15 -1
View File
@@ -23,13 +23,27 @@ from osv import osv,fields
class sale_order(osv.osv):
_inherit = 'sale.order'
_columns = {
'section_id': fields.many2one('crm.case.section', 'Sales Team'),
'categ_ids': fields.many2many('crm.case.categ', 'sale_order_category_rel', 'order_id', 'category_id', 'Categories', \
domain="['|',('section_id','=',section_id),('section_id','=',False), ('object_id.model', '=', 'crm.lead')]")
}
def create(self, cr, uid, vals, context=None):
order = super(sale_order, self).create(cr, uid, vals, context=context)
section_id = self.browse(cr, uid, order, context=context).section_id
if section_id:
followers = [follow.id for follow in section_id.message_follower_ids]
self.message_subscribe(cr, uid, [order], followers, context=context)
return order
def write(self, cr, uid, ids, vals, context=None):
if vals.get('section_id'):
section_id = self.pool.get('crm.case.section').browse(cr, uid, vals.get('section_id'), context=context)
if section_id:
vals['message_follower_ids'] = [(4, follower.id) for follower in section_id.message_follower_ids]
return super(sale_order, self).write(cr, uid, ids, vals, context=context)
sale_order()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+1474 -2563
View File
File diff suppressed because it is too large Load Diff