diff --git a/jikimo_purchase_request/models/purchase_request.py b/jikimo_purchase_request/models/purchase_request.py index 3db8a2d1..7bd6eea5 100644 --- a/jikimo_purchase_request/models/purchase_request.py +++ b/jikimo_purchase_request/models/purchase_request.py @@ -92,7 +92,7 @@ class PurchaseRequestLine(models.Model): continue if record.product_id.categ_id.name == '坯料': product_name = '' - match = re.search(r'(S\d{5}-\d*)', record.product_id.name) + match = re.search(r'(S\d{5}-\d+)', record.product_id.name) # 如果匹配成功,提取结果 if match: product_name = match.group(0) diff --git a/sf_manufacturing/models/sale_order.py b/sf_manufacturing/models/sale_order.py index 48a7cb02..cb214bc9 100644 --- a/sf_manufacturing/models/sale_order.py +++ b/sf_manufacturing/models/sale_order.py @@ -76,7 +76,7 @@ class SaleOrder(models.Model): 'embryo_redundancy_id': line.embryo_redundancy_id, } product_name = '' - match = re.search(r'(S\d{5}-\d*)', product.name) + match = re.search(r'(S\d{5}-\d+)', product.name) # 如果匹配成功,提取结果 if match: product_name = match.group(0)