From 1d66c1dbead1dc8047f88c581afca7745005e0c6 Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Thu, 21 Nov 2024 11:25:00 +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 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index 001f539f..518afd7d 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -1062,12 +1062,15 @@ class ResMrpWorkOrder(models.Model): workorder.state = 'pending' continue # ================= 如果制造订单刀具状态为[无效刀、缺刀] 或者 制造订单状态为[返工]========================== - if workorder.production_id.tool_state in ['1', '2'] or workorder.production_id.state == 'rework': - workorder.state = 'waiting' + if (workorder.production_id.tool_state in ['1', '2'] or workorder.production_id.state == 'rework' + or workorder.production_id.schedule_state != '已排' + or workorder.production_id.reservation_state != 'assigned'): + if workorder.state != 'waiting': + workorder.state = 'waiting' continue if workorder.production_id.programming_state == '已编程': workorder.state = 'ready' - else: + elif workorder.state != 'waiting': workorder.state = 'waiting' # re_work = self.env['mrp.workorder'].search([('production_id', '=', workorder.production_id.id), # ('processing_panel', '=', workorder.processing_panel),