[FIX]: Fix on_change_account_id() argument problem
bzr revid: atp@tinyerp.com-20121010103450-n4gt4ikp05t6b8yu
This commit is contained in:
parent
e65a9208b8
commit
98eaf2c2bc
|
@ -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
|
||||
|
|
|
@ -155,7 +155,6 @@ class hr_timesheet_sheet(osv.osv):
|
|||
return super(hr_timesheet_sheet, self).create(cr, uid, vals, *args, **argv)
|
||||
|
||||
def write(self, cr, uid, ids, vals, *args, **argv):
|
||||
print "------------vvvvvvvvvals",vals
|
||||
if 'employee_id' in vals:
|
||||
new_user_id = self.pool.get('hr.employee').browse(cr, uid, vals['employee_id']).user_id.id or False
|
||||
if not new_user_id:
|
||||
|
@ -390,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', uid))) 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)" 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, user_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)"/>
|
||||
<field domain="[('type','=','normal'), ('state', '<>', 'close')]" name="account_id" on_change="on_change_account_id(account_id, user_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