From 5a1ebabc872a5d19ced1213bc87d927ef94b50eb Mon Sep 17 00:00:00 2001 From: yuxianghui <3437689193@qq.com> Date: Wed, 25 Dec 2024 09:41:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E6=B2=A1=E6=9C=89=E5=B7=A5?= =?UTF-8?q?=E5=8D=95=E6=97=B6=EF=BC=8C=E5=88=B6=E9=80=A0=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=B0=B1=E5=B7=B2=E7=BB=8F=E5=AE=8C=E6=88=90=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_production.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index 66ab3183..66d0a678 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -381,7 +381,7 @@ 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.workorder_ids and 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'