From ed3feaf2a0a208a3e40b89a6627876ae5133e6a0 Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Tue, 24 Dec 2024 17:17:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=88=B6=E9=80=A0=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E7=8A=B6=E6=80=81=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_production.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index 8c2ffada..66ab3183 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -381,6 +381,10 @@ class MrpProduction(models.Model): # 如果制造订单的功能刀具为【无效刀】则制造订单状态改为返工 if production.tool_state == '2': production.state = 'rework' + if all(wo_state in ('done', 'rework', 'cancel') for wo_state in production.workorder_ids.mapped('state')): + if production.state not in ['scrap', 'rework']: + production.state = 'done' + # 退回调整 def technology_back_adjust(self):