[FIX]: Fix onchange account id problem

bzr revid: atp@tinyerp.com-20121011121201-h6030emuz00t55nv
This commit is contained in:
Atul Patel (OpenERP) 2012-10-11 17:42:01 +05:30
parent 23a0926efd
commit b27b12db1b
3 changed files with 3 additions and 3 deletions

View File

@ -154,7 +154,7 @@ class hr_analytic_timesheet(osv.osv):
'date': lambda self, cr, uid, ctx: ctx.get('date', fields.date.context_today(self,cr,uid,context=ctx)),
'user_id': lambda obj, cr, uid, ctx: ctx.get('user_id', uid),
}
def on_change_account_id(self, cr, uid, ids, account_id):
def on_change_account_id(self, cr, uid, ids, account_id, user_id):
return {'value':{}}
def on_change_date(self, cr, uid, ids, date):

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):
def on_change_account_id(self, cr, uid, ids, account_id, user_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)) for el in account_ids])
return dict([(el, self.on_change_account_id(cr, uid, ids, el, context.get('user_id', False) or uid)) for el in account_ids])
hr_timesheet_line()