diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index c67fd105..efa84c52 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -770,9 +770,13 @@ class MrpProduction(models.Model): 'date_from': date_planned_start, 'date_to': date_planned_end, }) + # work.write({'date_planned_start': date_planned_start, 'date_planned_finished': date_planned_end}) work.date_planned_start = date_planned_start work.date_planned_finished = date_planned_end - # work.write({'date_planned_start': date_planned_start, 'date_planned_finished': date_planned_end}) + routing_workcenter = self.env['mrp.routing.workcenter'].sudo().search( + [('name', '=', work.routing_type)]) + + work.write({'date_planned_start': date_planned_start, 'date_planned_finished': date_planned_end,'duration_expected':routing_workcenter.time_cycle}) # 修改标记已完成方法 def button_mark_done1(self):