修改正则匹配成品名字序号

This commit is contained in:
胡尧
2025-05-15 16:39:57 +08:00
parent ac4883db66
commit a29265f17d
2 changed files with 2 additions and 2 deletions

View File

@@ -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)

View File

@@ -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)