summaryrefslogtreecommitdiff
path: root/addons/analytic_user_function/analytic_user_function_view.xml
diff options
context:
space:
mode:
Diffstat (limited to 'addons/analytic_user_function/analytic_user_function_view.xml')
-rw-r--r--addons/analytic_user_function/analytic_user_function_view.xml42
1 files changed, 15 insertions, 27 deletions
diff --git a/addons/analytic_user_function/analytic_user_function_view.xml b/addons/analytic_user_function/analytic_user_function_view.xml
index 132f44ebef5..6010970b0ce 100644
--- a/addons/analytic_user_function/analytic_user_function_view.xml
+++ b/addons/analytic_user_function/analytic_user_function_view.xml
@@ -66,7 +66,7 @@
<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)</attribute>
+ <attribute name="on_change">on_change_account_id(account_id, user_id, unit_amount, is_timesheet, context)</attribute>
</xpath>
</field>
</record>
@@ -79,8 +79,7 @@
<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="domain">[('type','=','normal'),('state', '&lt;&gt;', 'close')]</attribute>
- <attribute name="on_change">on_change_account_id(account_id, user_id, unit_amount)</attribute>
+ <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>
@@ -88,50 +87,39 @@
<!-- hr.analytic.timesheet inherited views -->
<record model="ir.ui.view" id="hr_timesheet_line_form_inherit">
- <field name="name">hr.analytic.timesheet.form</field>
- <field name="model">hr.analytic.timesheet</field>
- <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_form"/>
+ <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="domain">[('type','=','normal'),('state', '&lt;&gt;', 'close')]</attribute>
- <attribute name="on_change">on_change_account_id(account_id, user_id, unit_amount)</attribute>
+ <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">hr.analytic.timesheet.form</field>
- <field name="model">hr.analytic.timesheet</field>
- <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_form"/>
+ <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, account_id, unit_amount)"/>
+ <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">hr.analytic.timesheet.tree</field>
- <field name="model">hr.analytic.timesheet</field>
- <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_tree"/>
+ <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="domain">[('type','=','normal'),('state', '&lt;&gt;', 'close')]</attribute>
- <attribute name="on_change">on_change_account_id(account_id, user_id, unit_amount)</attribute>
+ <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_tree_inherit_2">
- <field name="name">hr.analytic.timesheet.tree</field>
- <field name="model">hr.analytic.timesheet</field>
- <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_tree"/>
- <field name="arch" type="xml">
<xpath expr="/tree/field[@name='user_id']" position="replace">
- <field name="user_id" required="1" on_change="on_change_user_id(user_id, account_id, unit_amount)" context="{'default_groups_ref': ['base.group_user']}"/>
+ <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>
</field>
</record>
-
</data>
</openerp>