[ADD] project_timesheet: Add the on_change on account_id

bzr revid: sbh@tinyerp.com-20110104072018-jr2kxvveve15tyez
This commit is contained in:
Sbh (OpenERP) 2011-01-04 12:50:18 +05:30
parent cc320a68d8
commit 7513e31be3
2 changed files with 13 additions and 1 deletions

View File

@ -231,4 +231,16 @@ class res_partner(osv.osv):
context=context)
res_partner()
class account_analytic_line(osv.osv):
_inherit = "account.analytic.line"
def on_change_account_id(self, cr, uid, ids, account_id):
res = {}
if not account_id:
return res
res.setdefault('value',{})
acc = self.pool.get('account.analytic.account').browse(cr, uid, account_id)
st = acc.to_invoice.id
res['value']['to_invoice'] = st or False
return res
account_analytic_line()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -61,7 +61,7 @@
<field name="inherit_id" ref="account.view_account_analytic_line_form"/>
<field name="arch" type="xml">
<field name="account_id" position="replace">
<field name="account_id" string="Project"/>
<field name="account_id" string="Analytic account/project" on_change="on_change_account_id(account_id)"/>
</field>
</field>
</record>