From 5f7f905540f6462cf567c81045ac41a22efb21c2 Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Wed, 31 Jul 2024 14:59:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=B7=A5=E5=8D=95=E7=8A=B6?= =?UTF-8?q?=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_production.py | 3 --- sf_manufacturing/models/mrp_workorder.py | 6 +++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index 1b1aea17..e4dfb2a8 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -687,9 +687,6 @@ class MrpProduction(models.Model): for work_id in work_ids: if panel_sequence_list.get(work_id.name): work_id.sequence = panel_sequence_list[work_id.name] - if rec.tool_state in ['1', '2']: - rec.workorder_ids.filtered( - lambda a: a.routing_type == '装夹预调' and a.state in 'ready').compute_state() # 创建工单并进行排序 def _create_workorder(self, item): diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index 6989eb8f..50672b00 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -953,6 +953,9 @@ class ResMrpWorkOrder(models.Model): elif workorder.production_id.reservation_state != 'assigned': workorder.state = 'waiting' continue + if workorder.production_id.tool_state in ['1', '2'] and workorder.state == 'ready': + workorder.state = 'waiting' + continue logging.info('工序:%s' % workorder.sequence) logging.info('工单最终状态:%s' % workorder.state) @@ -988,9 +991,6 @@ class ResMrpWorkOrder(models.Model): # elif workorder.production_id.reservation_state != 'assigned' and workorder.state == 'ready': # workorder.state = 'waiting' - def compute_state(self): - self._compute_state() - # 重写工单开始按钮方法 def button_start(self): if self.routing_type == '装夹预调':