Skip to content

Commit

Permalink
[FIX] analytic_user_function - wrong override of domain for account_id
Browse files Browse the repository at this point in the history
  • Loading branch information
yvaucher-c2c authored and Stefan Rijnhart committed Jul 2, 2014
1 parent 42afe23 commit 477706e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions addons/analytic_user_function/analytic_user_function_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@
<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="replace">
<field name="account_id" domain="[('type','=','normal'),('state', '&lt;&gt;', 'close')]" on_change="on_change_account_id(account_id, user_id, unit_amount)"/>
<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>
</xpath>
</field>
</record>
Expand All @@ -78,8 +78,8 @@
<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="replace">
<field name="account_id" domain="[('type','=','normal'),('state', '&lt;&gt;', 'close')]" on_change="on_change_account_id(account_id, user_id, unit_amount)"/>
<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)</attribute>
</xpath>
</field>
</record>
Expand All @@ -90,8 +90,8 @@
<field name="model">hr.analytic.timesheet</field>
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='account_id']" position="replace">
<field name="account_id" domain="[('type','=','normal'),('state', '&lt;&gt;', 'close')]" on_change="on_change_account_id(account_id, user_id, unit_amount)" />
<xpath expr="//field[@name='account_id']" position="attributes">
<attribute name="on_change">on_change_account_id(account_id, user_id, unit_amount)</attribute>
</xpath>
</field>
</record>
Expand All @@ -112,8 +112,8 @@
<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='account_id']" position="replace">
<field name="account_id" domain="[('type','=','normal'),('state', '&lt;&gt;', 'close')]" on_change="on_change_account_id(account_id, user_id, unit_amount)" />
<xpath expr="/tree/field[@name='account_id']" position="attributes">
<attribute name="on_change">on_change_account_id(account_id, user_id, unit_amount)</attribute>
</xpath>
</field>
</record>
Expand Down
4 changes: 2 additions & 2 deletions addons/hr_timesheet/hr_timesheet_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<field name="date" on_change="on_change_date(date)"/>
<field name="user_id" on_change="on_change_user_id(user_id)" required="1" options='{"no_open": True}'/>
<field name="name"/>
<field domain="[('type','=','normal'),('use_timesheets','=',1)]" name="account_id" context="{'default_use_timesheets': 1, 'default_type': 'contract'}"/>
<field domain="[('type','in',['normal','contract']),('state', '&lt;&gt;', 'close'),('use_timesheets','=',1)]" name="account_id" context="{'default_use_timesheets': 1, 'default_type': 'contract'}"/>
<field name="unit_amount" string="Duration" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)" sum="Total time" widget="float_time"/>
<field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)" invisible="1"/>
<field name="journal_id" invisible="1"/>
Expand Down Expand Up @@ -47,7 +47,7 @@
</div>
</group>
<group string="Accounting">
<field domain="[('type','=','normal'),('state', '&lt;&gt;', 'close'),('parent_id','!=',False)]" name="account_id" select="1"/>
<field domain="[('type','in',['normal','contract']),('state', '&lt;&gt;', 'close'),('use_timesheets','=',1)]" name="account_id" select="1" context="{'default_use_timesheets': 1, 'default_type': 'contract'}"/>
<field name="amount"/>
<field name="general_account_id"/>
<field name="journal_id"/>
Expand Down
4 changes: 2 additions & 2 deletions addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
<field context="{'employee_id': employee_id, 'user_id':user_id, 'timesheet_date_from': date_from, 'timesheet_date_to': date_to}" name="timesheet_ids" nolabel="1">
<tree editable="top" string="Timesheet Activities">
<field name="date"/>
<field domain="[('type','in',['normal', 'contract']), ('state', '&lt;&gt;', 'close'),('use_timesheets','=',1)]" name="account_id" on_change="on_change_account_id(account_id, user_id)" context="{'default_use_timesheets': 1}"/>
<field domain="[('type','in',['normal', 'contract']), ('state', '&lt;&gt;', 'close'), ('use_timesheets','=',1)]" name="account_id" on_change="on_change_account_id(account_id, user_id)" context="{'default_use_timesheets': 1, 'default_type': 'contract'}"/>
<field name="name"/>
<field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)" widget="float_time" string="Hours" sum="Hours"/>
<field name="to_invoice" widget="selection"/>
Expand All @@ -119,7 +119,7 @@
</tree>
<form string="Timesheet Activities" version="7.0">
<field name="date"/>
<field domain="[('type','=','normal'), ('state', '&lt;&gt;', 'close')]" name="account_id" on_change="on_change_account_id(account_id, user_id)"/>
<field domain="[('type','in',['normal', 'contract']), ('state', '&lt;&gt;', 'close'), ('use_timesheets','=',1)]" name="account_id" on_change="on_change_account_id(account_id, user_id)" context="{'default_use_timesheets': 1, 'default_type': 'contract'}"/>
<field name="name"/>
<field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)" widget="float_time"/>
<field name="to_invoice"/>
Expand Down

0 comments on commit 477706e

Please sign in to comment.