[FIX]: Fix on_change_analytic_id problem
bzr revid: atp@tinyerp.com-20121010150849-u4cldadvfjzmw8mj
This commit is contained in:
parent
d639f10dad
commit
e2a28b011a
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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', '<>', '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)" 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', '<>', 'close')]" name="account_id" on_change="on_change_account_id(account_id, user_id)"/>
|
||||
<field domain="[('type','=','normal'), ('state', '<>', '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"/>
|
||||
|
|
Loading…
Reference in New Issue