[FIX] mrp: update only sooner scheduled date
Starting a workorder should update the scheduled date only if the production is started sooner than expected. In this case we want to clear the calendar for the other production. If the production is started later than expected, updating the calendar has no effect. We leave the scheduled date unchanged to keep the information Task : 2278147
This commit is contained in:
@@ -545,7 +545,8 @@ class MrpWorkorder(models.Model):
|
||||
vals['leave_id'] = leave.id
|
||||
return self.write(vals)
|
||||
else:
|
||||
vals['date_planned_start'] = start_date
|
||||
if self.date_planned_start > start_date:
|
||||
vals['date_planned_start'] = start_date
|
||||
if self.date_planned_finished < start_date:
|
||||
vals['date_planned_finished'] = start_date
|
||||
return self.write(vals)
|
||||
|
||||
Reference in New Issue
Block a user