From ef453dbc1e23acd62e2a1a865b46c65fc740d1df Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Wed, 18 Sep 2024 11:53:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E5=8D=95=E7=8A=B6=E6=80=81=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_workorder.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index 38b75c28..1c3ade80 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -1025,20 +1025,20 @@ class ResMrpWorkOrder(models.Model): # 查询工序最小的非完工、非返工的装夹预调工单 work_id = self.search( [('production_id', '=', workorder.production_id.id), - ('routing_type', '=', '装夹预调'), ('state', 'not in', ['rework', 'done', 'cancel'])], limit=1, order="sequence") - if workorder == work_id: - if workorder.production_id.reservation_state == 'assigned': - workorder.state = 'ready' - elif workorder.production_id.reservation_state != 'assigned': - workorder.state = 'waiting' - continue - elif (workorder.name == '装夹预调' and - workorder.state not in ['rework', 'done', 'cancel']): - if workorder.state != 'pending': - workorder.state = 'pending' + if work_id.routing_type == '装夹预调': + if workorder == work_id: + if workorder.production_id.reservation_state == 'assigned': + workorder.state = 'ready' + elif workorder.production_id.reservation_state != 'assigned': + workorder.state = 'waiting' + continue + elif (workorder.name == '装夹预调' and + workorder.state not in ['rework', 'done', 'cancel']): + if workorder.state != 'pending': + workorder.state = 'pending' if workorder.production_id.tool_state in ['1', '2'] and workorder.state == 'ready': workorder.state = 'waiting' continue