diff --git a/sf_manufacturing/models/mrp_production.py b/sf_manufacturing/models/mrp_production.py index f52cf05d..ab6e560e 100644 --- a/sf_manufacturing/models/mrp_production.py +++ b/sf_manufacturing/models/mrp_production.py @@ -279,7 +279,7 @@ class MrpProduction(models.Model): production_id.part_name = production_id.product_id.part_name elif production_id.product_id.categ_id.type == '坯料': product_name = '' - match = re.search(r'(S\d{5}-\d)', production_id.product_id.name) + match = re.search(r'(S\d{5}-\d+)', production_id.product_id.name) # 如果匹配成功,提取结果 if match: product_name = match.group(0) diff --git a/sf_manufacturing/models/product_template.py b/sf_manufacturing/models/product_template.py index 775df50e..57676d90 100644 --- a/sf_manufacturing/models/product_template.py +++ b/sf_manufacturing/models/product_template.py @@ -795,7 +795,7 @@ class ResProductMo(models.Model): for record in self: if record.categ_id.name == '坯料': product_name = '' - match = re.search(r'(S\d{5}-\d)', record.name) + match = re.search(r'(S\d{5}-\d+)', record.name) # 如果匹配成功,提取结果 if match: product_name = match.group(0) diff --git a/sf_manufacturing/models/purchase_order.py b/sf_manufacturing/models/purchase_order.py index e967215d..14e18385 100644 --- a/sf_manufacturing/models/purchase_order.py +++ b/sf_manufacturing/models/purchase_order.py @@ -208,7 +208,7 @@ class PurchaseOrderLine(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/stock.py b/sf_manufacturing/models/stock.py index d8caae88..d8629eec 100644 --- a/sf_manufacturing/models/stock.py +++ b/sf_manufacturing/models/stock.py @@ -849,7 +849,7 @@ class ReStockMove(models.Model): move.part_name = move.product_id.part_name elif move.product_id.categ_id.type == '坯料': product_name = '' - match = re.search(r'(S\d{5}-\d)', move.product_id.name) + match = re.search(r'(S\d{5}-\d+)', move.product_id.name) # 如果匹配成功,提取结果 if match: product_name = match.group(0) @@ -881,7 +881,7 @@ class ReStockMove(models.Model): continue product_name = '' logging.info('制造订单的产品 %s', production_id.product_id.name) - match = re.search(r'(S\d{5}-\d)', production_id.product_id.name) + match = re.search(r'(S\d{5}-\d+)', production_id.product_id.name) # 如果匹配成功,提取结果 if match: product_name = match.group(0)