From 09f8f5c0fd78f32b0bf3709bf4140540217d1aae Mon Sep 17 00:00:00 2001 From: mgw <1392924357@qq.com> Date: Mon, 17 Feb 2025 17:30:02 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/wizard/sale_order_cancel.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sf_manufacturing/wizard/sale_order_cancel.py b/sf_manufacturing/wizard/sale_order_cancel.py index e00b14fb..c78fbe39 100644 --- a/sf_manufacturing/wizard/sale_order_cancel.py +++ b/sf_manufacturing/wizard/sale_order_cancel.py @@ -113,7 +113,11 @@ class SFSaleOrderCancelLine(models.TransientModel): 'draft': '报价', 'cancel': '已取消', 'pass': '通过的', - 'fail': '失败的' + 'fail': '失败的', + 'done': '已完成', + 'rework': '返工', + 'purchase': '采购订单', + 'ready': '就绪' } # 检查销售订单 @@ -313,7 +317,7 @@ class SFSaleOrderCancelLine(models.TransientModel): 'product_name': check.product_id.name, 'quantity': 1, 'doc_state': map_dict.get(check.quality_state, check.quality_state), - 'cancel_reason': '已有异动' if check.quality_state not in ['none'] else '' + 'cancel_reason': '已有异动' if check.quality_state not in ['none', 'cancel'] else '' } lines.append(self.create(vals)) sequence += 1 From 9fce93e1eff2c6c436a3562db4c63b2d12be73a3 Mon Sep 17 00:00:00 2001 From: mgw <1392924357@qq.com> Date: Mon, 17 Feb 2025 17:34:54 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=B7=A5=E5=8D=95?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=94=B9=E5=8F=98=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/mrp_workorder.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sf_manufacturing/models/mrp_workorder.py b/sf_manufacturing/models/mrp_workorder.py index 3717cebe..fb458f28 100644 --- a/sf_manufacturing/models/mrp_workorder.py +++ b/sf_manufacturing/models/mrp_workorder.py @@ -1087,7 +1087,8 @@ class ResMrpWorkOrder(models.Model): if (workorder.production_id.production_type == '人工线下加工' and workorder.production_id.schedule_state == '已排' and len(workorder.production_id.picking_ids.filtered( - lambda w: w.state not in ['done', 'cancel'])) == 0): + lambda w: w.state not in ['done', 'cancel'])) == 0 + and workorder.production_id.programming_state == '已编程'): if workorder.is_subcontract is True: purchase_orders_id = self._get_surface_technics_purchase_ids() if purchase_orders_id.state == 'purchase':