[FIX] Timesheets Modules : Issues could appear due to the change of method signature in account.analytic.line.on_change_account_id(). To prevent such issues without building a bridge module, this method always takes the right number of arguments, even if analytic_user_function is not installed
This commit is contained in:
@@ -58,64 +58,11 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- hr_timesheet_sheet.sheet inherited view -->
|
||||
<record model="ir.ui.view" id="hr_timesheet_sheet_form_inherit">
|
||||
<field name="name">hr.timesheet.sheet.form.tree</field>
|
||||
<field name="model">hr_timesheet_sheet.sheet</field>
|
||||
<field name="priority" eval="18"/>
|
||||
<field name="inherit_id" ref="hr_timesheet_sheet.hr_timesheet_sheet_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='timesheet_ids']/tree/field[@name='account_id']" position="attributes">
|
||||
<attribute name="on_change">on_change_account_id(account_id, user_id, unit_amount, is_timesheet, context)</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- hr_timesheet_sheet.sheet inherited view -->
|
||||
<record model="ir.ui.view" id="hr_timesheet_sheet_form_inherit1">
|
||||
<field name="name">hr.timesheet.sheet.form.form</field>
|
||||
<field name="model">hr_timesheet_sheet.sheet</field>
|
||||
<field name="priority" eval="19"/>
|
||||
<field name="inherit_id" ref="hr_timesheet_sheet.hr_timesheet_sheet_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='timesheet_ids']/form/field[@name='account_id']" position="attributes">
|
||||
<attribute name="on_change">on_change_account_id(account_id, user_id, unit_amount, is_timesheet, context)</attribute>
|
||||
<attribute name="context">{'default_invoice_on_timesheets': 1}</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- hr.analytic.timesheet inherited views -->
|
||||
<record model="ir.ui.view" id="hr_timesheet_line_form_inherit">
|
||||
<field name="name">account.analytic.line.form</field>
|
||||
<field name="model">account.analytic.line</field>
|
||||
<field name="inherit_id" ref="hr_timesheet_invoice.hr_timesheet_line_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='account_id']" position="attributes">
|
||||
<attribute name="on_change">on_change_account_id(account_id, user_id, unit_amount, is_timesheet, context)</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="hr_timesheet_line_form_inherit_2">
|
||||
<field name="name">account.analytic.line.form</field>
|
||||
<field name="model">account.analytic.line</field>
|
||||
<field name="inherit_id" ref="hr_timesheet_invoice.hr_timesheet_line_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='user_id']" position="replace">
|
||||
<field name="user_id" required="1" on_change="on_change_user_id(user_id, unit_amount, account_id, is_timesheet, context)"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="hr_timesheet_line_tree_inherit">
|
||||
<field name="name">account.analytic.line.tree</field>
|
||||
<field name="model">account.analytic.line</field>
|
||||
<field name="inherit_id" ref="hr_timesheet_invoice.hr_timesheet_line_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/tree/field[@name='account_id']" position="attributes">
|
||||
<attribute name="on_change">on_change_account_id(account_id, user_id, unit_amount, is_timesheet, context)</attribute>
|
||||
</xpath>
|
||||
<xpath expr="/tree/field[@name='user_id']" position="replace">
|
||||
<field name="user_id" required="1" on_change="on_change_user_id(user_id, unit_amount, account_id, is_timesheet, context)" context="{'default_groups_ref': ['base.group_user']}"/>
|
||||
</xpath>
|
||||
|
||||
Reference in New Issue
Block a user