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: