From 4b443e65f63dca74567ce15821ad6fc18fb1ba5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E5=B0=A7?= Date: Fri, 16 May 2025 09:14:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=BA=93=E5=AD=98=E5=8D=95?= =?UTF-8?q?=E6=8D=AE=E9=9B=B6=E4=BB=B6=E5=9B=BE=E5=8F=B7=E9=9B=B6=E4=BB=B6?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E4=B8=8D=E5=AF=B9=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 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 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) 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)