<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', '<>', '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>
<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', '<>', '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>
<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', '<>', '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>
<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', '<>', '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>
<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', '<>', '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"/>
</div>
</group>
<group string="Accounting">
- <field domain="[('type','=','normal'),('state', '<>', 'close'),('parent_id','!=',False)]" name="account_id" select="1"/>
+ <field domain="[('type','in',['normal','contract']),('state', '<>', '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"/>
<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', '<>', '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', '<>', '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"/>
</tree>
<form string="Timesheet Activities" version="7.0">
<field name="date"/>
- <field domain="[('type','=','normal'), ('state', '<>', 'close')]" name="account_id" on_change="on_change_account_id(account_id, user_id)"/>
+ <field domain="[('type','in',['normal', 'contract']), ('state', '<>', '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"/>