解决修改产品名称带来的影响

This commit is contained in:
胡尧
2025-06-16 09:33:52 +08:00
parent 347019d7ee
commit 1811dbf0fd
5 changed files with 12 additions and 0 deletions

View File

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

View File

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

View File

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

View File

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

View File

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