[FIX] mrp: write on done WO
Do not allow to write on a done WO except for time log. Partial backport of aafa0490cb540f1646e1d81c6cdb0cfd4a8b2429 opw-1946121 closes odoo/odoo#31917 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
@@ -240,7 +240,7 @@ class MrpWorkorder(models.Model):
|
||||
|
||||
@api.multi
|
||||
def write(self, values):
|
||||
if ('date_planned_start' in values or 'date_planned_finished' in values) and any(workorder.state == 'done' for workorder in self):
|
||||
if list(values.keys()) != ['time_ids'] and any(workorder.state == 'done' for workorder in self):
|
||||
raise UserError(_('You can not change the finished work order.'))
|
||||
return super(MrpWorkorder, self).write(values)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user