diff --git a/addons/mrp/models/mrp_workorder.py b/addons/mrp/models/mrp_workorder.py index ff9a7979737..f22a39c9af1 100644 --- a/addons/mrp/models/mrp_workorder.py +++ b/addons/mrp/models/mrp_workorder.py @@ -454,13 +454,13 @@ class MrpWorkorder(models.Model): raise UserError(_('The planned end date of the work order cannot be prior to the planned start date, please correct this to save the work order.')) if 'duration_expected' not in values and not self.env.context.get('bypass_duration_calculation'): if values.get('date_planned_start') and values.get('date_planned_finished'): - computed_finished_time = self._calculate_date_planned_finished(start_date) + computed_finished_time = workorder._calculate_date_planned_finished(start_date) values['date_planned_finished'] = computed_finished_time elif values.get('date_planned_start'): - computed_duration = self._calculate_duration_expected(date_planned_start=start_date) + computed_duration = workorder._calculate_duration_expected(date_planned_start=start_date) values['duration_expected'] = computed_duration elif values.get('date_planned_finished'): - computed_duration = self._calculate_duration_expected(date_planned_finished=end_date) + computed_duration = workorder._calculate_duration_expected(date_planned_finished=end_date) values['duration_expected'] = computed_duration # Update MO dates if the start date of the first WO or the # finished date of the last WO is update.