[FIX]: Fix on_change_analytic_id problem

bzr revid: atp@tinyerp.com-20121010150849-u4cldadvfjzmw8mj
This commit is contained in:
Atul Patel (OpenERP) 2012-10-10 20:38:49 +05:30
parent d639f10dad
commit e2a28b011a
4 changed files with 5 additions and 5 deletions

View File

@ -66,7 +66,7 @@ class hr_analytic_timesheet(osv.osv):
def on_change_account_id(self, cr, uid, ids, account_id, user_id, unit_amount=0):
def on_change_account_id(self, cr, uid, ids, account_id, user_id=False, unit_amount=0):
res = {}
if not (account_id):
#avoid a useless call to super

View File

@ -174,7 +174,7 @@ account_analytic_line()
class hr_analytic_timesheet(osv.osv):
_inherit = "hr.analytic.timesheet"
def on_change_account_id(self, cr, uid, ids, account_id, user_id):
def on_change_account_id(self, cr, uid, ids, account_id):
res = {}
if not account_id:
return res

View File

@ -389,7 +389,7 @@ class hr_timesheet_line(osv.osv):
return True
def multi_on_change_account_id(self, cr, uid, ids, account_ids, context=None):
return dict([(el, self.on_change_account_id(cr, uid, ids, el, context.get('user_id', uid))) for el in account_ids])
return dict([(el, self.on_change_account_id(cr, uid, ids, el)) for el in account_ids])
hr_timesheet_line()

View File

@ -97,7 +97,7 @@
<field colspan="4" context="{'user_id':user_id}" name="timesheet_ids" nolabel="1">
<tree editable="top" string="Timesheet Lines">
<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)" 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"/>
@ -110,7 +110,7 @@
</tree>
<form string="Timesheet Lines" 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','=','normal'), ('state', '&lt;&gt;', 'close')]" name="account_id" on_change="on_change_account_id(account_id)"/>
<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"/>