[FIX] Project_timesheet

lp bug: https://launchpad.net/bugs/1023047 fixed

bzr revid: api@openerp.com-20121108084846-xv350qki85cd5ouq
This commit is contained in:
Arnaud Pineux
2012-11-08 09:48:46 +01:00
parent 02bac97be9
commit 784133eac6
@@ -199,8 +199,7 @@ class project_work(osv.osv):
if amount_unit and 'amount' in amount_unit.get('value',{}):
vals_line['amount'] = amount_unit['value']['amount']
state = self.pool.get('hr.analytic.timesheet').browse(cr,uid,line_id.id,context=context).sheet_id.state
if state != 'confirm' and state != 'done':
if line_id.sheet_id.state in ['confirm' 'done']:
self.pool.get('hr.analytic.timesheet').write(cr, uid, [line_id.id], vals_line, context=context)
return super(project_work,self).write(cr, uid, ids, vals, context)