[IMP]:added domain and default context while creating a account from timesheet line.

bzr revid: apa@tinyerp.com-20120529070000-k9p3j9th9e1abzny
This commit is contained in:
Amit Patel (OpenERP) 2012-05-29 12:30:00 +05:30
parent cc38db164d
commit 65f31b9061
3 changed files with 4 additions and 5 deletions

View File

@ -12,7 +12,7 @@
<field name="user_id" on_change="on_change_user_id(user_id)" required="1"/>
<field name="journal_id" invisible="1"/>
<field name="name"/>
<field domain="[('type','=','normal')]" name="account_id"/>
<field domain="[('type','=','normal'),('use_timesheets','=',1)]" name="account_id" context="{'default_use_timesheets': 1}"/>
<field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)" required="1" domain="[('type','=','service')]" invisible="1"/>
<field name="unit_amount" 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"/>

View File

@ -43,7 +43,7 @@
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_form"/>
<field name="arch" type="xml">
<field name="account_id" position="replace">
<field domain="[('type','=','normal'),('state', '&lt;&gt;', 'close')]" name="account_id" on_change="on_change_account_id(account_id)" select="1" context="{'search_default_use_timesheets': 1, 'default_use_timesheets': 1}"/>
<field domain="[('type','=','normal'),('state', '&lt;&gt;', 'close'),('use_timesheets','=',1)]" name="account_id" on_change="on_change_account_id(account_id)" select="1" context="{'default_use_timesheets': 1}"/>
</field>
</field>
</record>
@ -66,9 +66,8 @@
<field name="type">tree</field>
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_tree"/>
<field name="arch" type="xml">
<field name="account_id" position="replace">
<field domain="[('type','=','normal'),('state', '&lt;&gt;', 'close')]" name="account_id" on_change="on_change_account_id(account_id)" context="{'search_default_use_timesheets': 1, 'default_use_timesheets': 1}"/>
<field domain="[('type','=','normal'),('state', '&lt;&gt;', 'close'),('use_timesheets','=',1)]" name="account_id" on_change="on_change_account_id(account_id)" select="1" context="{'default_use_timesheets': 1}"/>
</field>
</field>
</record>

View File

@ -109,7 +109,7 @@
<field colspan="4" context="{'date':date_current,'user_id':user_id}" domain="[('name','=',date_current)]" name="timesheet_ids" nolabel="1">
<tree editable="top" string="Timesheet Lines">
<field invisible="1" name="date"/>
<field domain="[('type','=','normal'), ('state', '&lt;&gt;', 'close')]" name="account_id" on_change="on_change_account_id(account_id)"/>
<field domain="[('type','=','normal'), ('state', '&lt;&gt;', 'close'),('use_timesheets','=',1)]" name="account_id" on_change="on_change_account_id(account_id)" context="{'default_use_timesheets': 1}"/>
<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" widget="selection"/>