[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:
parent
ab9ac783db
commit
d66c96ffa9
|
@ -200,7 +200,8 @@ class project_work(osv.osv):
|
||||||
if amount_unit and 'amount' in amount_unit.get('value',{}):
|
if amount_unit and 'amount' in amount_unit.get('value',{}):
|
||||||
vals_line['amount'] = amount_unit['value']['amount']
|
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)
|
return super(project_work,self).write(cr, uid, ids, vals, context)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue