summaryrefslogtreecommitdiff
path: root/addons/analytic_user_function/analytic_user_function_view.xml
diff options
context:
space:
mode:
authorodoo-tac <tac@odoo.com>2015-02-24 16:52:20 +0100
committerodoo-tac <tac@odoo.com>2015-04-28 10:31:18 +0200
commit14183ba2be54a10247419f110f512cc6844a41b4 (patch)
tree1a074c4c2c0a3d46a1ff9f5eb060305365745d87 /addons/analytic_user_function/analytic_user_function_view.xml
parenteb91b14837b20601b9d8cba80829883f85263b8e (diff)
[REF] Refactored hr_timesheet: Refactored the "timesheet" model in several modules. hr.analytic.timesheet is removed, and account.analytic.line is used directly to represent timesheets.
Also removed worklogs on tasks and replaced them by generic timesheets, i.e. account.analytic.line(s)
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>