diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index d5bbb88c..2fe44d86 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -143,6 +143,7 @@ class ResMrpWorkOrder(models.Model): is_trayed = fields.Boolean(string='是否绑定托盘', default=False) tag_type = fields.Selection([("重新加工", "重新加工")], string="标签", tracking=True) + technology_design_id = fields.Many2one('sf.technology.design') def _compute_default_construction_period_status(self): need_list = ['pending', 'waiting', 'ready', 'progress', 'to be detected', 'done'] @@ -785,7 +786,7 @@ class ResMrpWorkOrder(models.Model): routing_types = ['切割', '装夹预调', 'CNC加工', '解除装夹'] if route.route_id.routing_type in routing_types: routing_workcenter = self.env['mrp.routing.workcenter'].sudo().search( - [('name', '=', oute.routing_type if hasattr(route, 'routing_type') else route.route_id.routing_type)]) + [('name', '=', route.routing_type if hasattr(route, 'routing_type') else route.route_id.routing_type)]) duration_expected = routing_workcenter.time_cycle reserved_duration = routing_workcenter.reserved_duration else: @@ -809,6 +810,7 @@ class ResMrpWorkOrder(models.Model): 'date_planned_finished': datetime.now() + timedelta(days=1), 'duration_expected': duration_expected, 'duration': 0, + 'technology_design_id': route.id, # 'tag_type': '重新加工' if item is False else False, 'reserved_duration': reserved_duration, }] @@ -848,6 +850,7 @@ class ResMrpWorkOrder(models.Model): 'name': route.process_parameters_id.display_name, 'processing_panel': '', 'sequence': route.sequence, + 'technology_design_id': route.id, 'routing_type': '表面工艺', 'surface_technics_parameters_id': route.process_parameters_id.id, 'work_state': '',