From 1811dbf0fdf82629cc51001fa250059c338d9fbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E5=B0=A7?= Date: Mon, 16 Jun 2025 09:33:52 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=BF=AE=E6=94=B9=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E5=90=8D=E7=A7=B0=E5=B8=A6=E6=9D=A5=E7=9A=84=E5=BD=B1?= =?UTF-8?q?=E5=93=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jikimo_purchase_request/models/purchase_request.py | 2 ++ sf_manufacturing/models/mrp_production.py | 2 ++ sf_manufacturing/models/product_template.py | 2 ++ sf_manufacturing/models/purchase_order.py | 2 ++ sf_manufacturing/models/stock.py | 4 ++++ 5 files changed, 12 insertions(+) diff --git a/jikimo_purchase_request/models/purchase_request.py b/jikimo_purchase_request/models/purchase_request.py index 436f22e7..7287cb6a 100644 --- a/jikimo_purchase_request/models/purchase_request.py +++ b/jikimo_purchase_request/models/purchase_request.py @@ -150,6 +150,8 @@ class PurchaseRequestLine(models.Model): # 如果匹配成功,提取结果 if match: product_name = match.group(0) + else: + product_name = record.product_id.name sale_order_name = '' match_sale = re.search(r'S(\d+)', record.product_id.name) if match_sale: diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index 74460d4c..46c0ae39 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -283,6 +283,8 @@ class MrpProduction(models.Model): # 如果匹配成功,提取结果 if match: product_name = match.group(0) + else: + product_name = production_id.product_id.name if production_id.sale_order_id: sale_order = production_id.sale_order_id else: diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index 242e0ff4..d40da113 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -799,6 +799,8 @@ class ResProductMo(models.Model): # 如果匹配成功,提取结果 if match: product_name = match.group(0) + else: + product_name = record.name sale_order_name = '' match_sale = re.search(r'S(\d+)', record.name) if match_sale: diff --git a/sf_manufacturing/models/purchase_order.py b/sf_manufacturing/models/purchase_order.py index 14e18385..9143835e 100644 --- a/sf_manufacturing/models/purchase_order.py +++ b/sf_manufacturing/models/purchase_order.py @@ -212,6 +212,8 @@ class PurchaseOrderLine(models.Model): # 如果匹配成功,提取结果 if match: product_name = match.group(0) + else: + product_name = record.product_id.name sale_order_name = '' match_sale = re.search(r'S(\d+)', record.product_id.name) if match_sale: diff --git a/sf_manufacturing/models/stock.py b/sf_manufacturing/models/stock.py index e947b373..0e3f76cf 100644 --- a/sf_manufacturing/models/stock.py +++ b/sf_manufacturing/models/stock.py @@ -861,6 +861,8 @@ class ReStockMove(models.Model): # 如果匹配成功,提取结果 if match: product_name = match.group(0) + else: + product_name = move.product_id.name if move.picking_id.sale_order_id: sale_order = move.picking_id.sale_order_id else: @@ -893,6 +895,8 @@ class ReStockMove(models.Model): # 如果匹配成功,提取结果 if match: product_name = match.group(0) + else: + product_name = production_id.product_id.name if move.picking_id.sale_order_id: sale_order = move.picking_id.sale_order_id else: