[FIX] mrp: fix name of leave related to WO

Instead using production name + name of WO as name in the
leave record, use the display name of WO to reprensent uniquely
the leave (even this record is not really reprensent in views).

task-2241471
This commit is contained in:
Rémy Voet (ryv)
2020-06-15 16:59:41 +02:00
committed by Simon Lejeune
parent 38c375783f
commit f647b68243
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -1099,7 +1099,7 @@ class MrpProduction(models.Model):
# Create leave on chosen workcenter calendar
leave = self.env['resource.calendar.leaves'].create({
'name': self.name + ' - ' + workorder.name,
'name': workorder.display_name,
'calendar_id': best_workcenter.resource_calendar_id.id,
'date_from': best_start_date,
'date_to': best_finished_date,
+1 -1
View File
@@ -730,7 +730,7 @@ class MrpWorkorder(models.Model):
}
if not self.leave_id:
leave = self.env['resource.calendar.leaves'].create({
'name': self.production_id.name + ' - ' + self.name,
'name': self.display_name,
'calendar_id': self.workcenter_id.resource_calendar_id.id,
'date_from': start_date,
'date_to': start_date + relativedelta(minutes=self.duration_expected),