bugfixes_timesheet_invoice
bzr revid: fp@tinyerp.com-20081120165039-p3v3crbmqs6dmgkm
This commit is contained in:
parent
1823c50af3
commit
61a8e3b6e0
|
@ -109,6 +109,9 @@ class hr_analytic_timesheet(osv.osv):
|
|||
'date' : lambda self,cr,uid,ctx: ctx.get('date', time.strftime('%Y-%m-%d')),
|
||||
'user_id' : lambda obj, cr, uid, ctx : ctx.get('user_id', uid),
|
||||
}
|
||||
def on_change_account_id(self, cr, uid, ids, account_id):
|
||||
return {'value':{}}
|
||||
|
||||
def create(self, cr, uid, vals, context={}):
|
||||
try:
|
||||
res = super(hr_analytic_timesheet, self).create(cr, uid, vals, context)
|
||||
|
|
|
@ -112,6 +112,8 @@ def _write(self, cr, uid, data, emp_id, context):
|
|||
res['account_id'] = data['form']['account_id']
|
||||
res['unit_amount'] = hour
|
||||
res.update(up)
|
||||
up = timesheet_obj.on_change_account_id(cr, uid, [], res['account_id']).get('value', {})
|
||||
res.update(up)
|
||||
return timesheet_obj.create(cr, uid, res, context)
|
||||
|
||||
def _sign_out_result_end(self, cr, uid, data, context):
|
||||
|
|
|
@ -51,7 +51,7 @@ def _action_line_create(self, cr, uid, data, context):
|
|||
'product_uom_id': unit_id,
|
||||
'product_id': product_id,
|
||||
'amount': work.hours or 0.0,
|
||||
'account_id': aa.id
|
||||
'account_id': aa.id,
|
||||
}
|
||||
res2 = ts.on_change_unit_amount(cr, uid, False, product_id, work.hours or 0.0,unit_id, context)
|
||||
if res2:
|
||||
|
|
Loading…
Reference in New Issue