[FIX] project_timesheet: don't trigger write if there is nothing to write

Triggering an empty write could break constraint (can not update past timesheet) (opw 606963)
This commit is contained in:
Holger Brunn 2014-06-05 15:44:18 +02:00 committed by Martin Trigaux
parent ab9ac783db
commit d66c96ffa9
1 changed files with 2 additions and 1 deletions

View File

@ -200,7 +200,8 @@ class project_work(osv.osv):
if amount_unit and 'amount' in amount_unit.get('value',{}):
vals_line['amount'] = amount_unit['value']['amount']
self.pool.get('hr.analytic.timesheet').write(cr, uid, [line_id.id], vals_line, context=context)
if vals_line:
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)