From 784133eac6583f176d7ba29e48fe770f6863fc03 Mon Sep 17 00:00:00 2001 From: Arnaud Pineux Date: Thu, 8 Nov 2012 09:48:46 +0100 Subject: [PATCH] [FIX] Project_timesheet lp bug: https://launchpad.net/bugs/1023047 fixed bzr revid: api@openerp.com-20121108084846-xv350qki85cd5ouq --- addons/project_timesheet/project_timesheet.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/project_timesheet/project_timesheet.py b/addons/project_timesheet/project_timesheet.py index 4d807f104c3..3f85e5c2e79 100644 --- a/addons/project_timesheet/project_timesheet.py +++ b/addons/project_timesheet/project_timesheet.py @@ -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)