From ae1028972c0bad987b21e62023c3602ef4fcf693 Mon Sep 17 00:00:00 2001 From: mgw <1392924357@qq.com> Date: Thu, 20 Mar 2025 16:19:55 +0800 Subject: [PATCH] =?UTF-8?q?sf-=E5=9D=AF=E6=96=99=E7=9A=84=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E6=96=B9=E5=BC=8F=E6=98=AF=E8=87=AA=E5=8A=A0=E5=B7=A5?= =?UTF-8?q?=EF=BC=8C=E7=94=9F=E6=88=90=E7=9A=84=E5=9D=AF=E6=96=99=E5=88=B6?= =?UTF-8?q?=E9=80=A0=E8=AE=A2=E5=8D=95=E7=9A=84=E6=8E=92=E7=A8=8B=E5=8D=95?= =?UTF-8?q?=E4=B8=8D=E5=9C=A8=E5=8F=96=E6=B6=88=E5=88=97=E8=A1=A8=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/wizard/sale_order_cancel.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sf_manufacturing/wizard/sale_order_cancel.py b/sf_manufacturing/wizard/sale_order_cancel.py index 3834bd8e..646edd53 100644 --- a/sf_manufacturing/wizard/sale_order_cancel.py +++ b/sf_manufacturing/wizard/sale_order_cancel.py @@ -332,7 +332,9 @@ class SFSaleOrderCancelLine(models.TransientModel): p1 = 0 for plan_order in sf_plan_orders: if not plan_order.product_id.default_code: - continue + product_name = plan_order.product_id.name + else: + product_name = f'[{plan_order.product_id.default_code}] {plan_order.product_id.name}' p1 += 1 vals = { 'wizard_id': wizard_id, @@ -342,7 +344,7 @@ class SFSaleOrderCancelLine(models.TransientModel): 'operation_type': '', 'doc_number': plan_order.name, 'line_number': p1, - 'product_name': f'[{plan_order.product_id.default_code}] {plan_order.product_id.name}', + 'product_name': product_name, 'quantity': 1, 'doc_state': plan_map_dict.get(plan_order.state, plan_order.state), 'cancel_reason': '已有异动' if plan_order.state not in ['draft', 'cancel'] else ''