解决库存单据零件图号零件名称不对的问题
This commit is contained in:
@@ -279,7 +279,7 @@ class MrpProduction(models.Model):
|
|||||||
production_id.part_name = production_id.product_id.part_name
|
production_id.part_name = production_id.product_id.part_name
|
||||||
elif production_id.product_id.categ_id.type == '坯料':
|
elif production_id.product_id.categ_id.type == '坯料':
|
||||||
product_name = ''
|
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:
|
if match:
|
||||||
product_name = match.group(0)
|
product_name = match.group(0)
|
||||||
|
|||||||
@@ -795,7 +795,7 @@ class ResProductMo(models.Model):
|
|||||||
for record in self:
|
for record in self:
|
||||||
if record.categ_id.name == '坯料':
|
if record.categ_id.name == '坯料':
|
||||||
product_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:
|
if match:
|
||||||
product_name = match.group(0)
|
product_name = match.group(0)
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ class PurchaseOrderLine(models.Model):
|
|||||||
continue
|
continue
|
||||||
if record.product_id.categ_id.name == '坯料':
|
if record.product_id.categ_id.name == '坯料':
|
||||||
product_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:
|
if match:
|
||||||
product_name = match.group(0)
|
product_name = match.group(0)
|
||||||
|
|||||||
@@ -849,7 +849,7 @@ class ReStockMove(models.Model):
|
|||||||
move.part_name = move.product_id.part_name
|
move.part_name = move.product_id.part_name
|
||||||
elif move.product_id.categ_id.type == '坯料':
|
elif move.product_id.categ_id.type == '坯料':
|
||||||
product_name = ''
|
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:
|
if match:
|
||||||
product_name = match.group(0)
|
product_name = match.group(0)
|
||||||
@@ -881,7 +881,7 @@ class ReStockMove(models.Model):
|
|||||||
continue
|
continue
|
||||||
product_name = ''
|
product_name = ''
|
||||||
logging.info('制造订单的产品 %s', production_id.product_id.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:
|
if match:
|
||||||
product_name = match.group(0)
|
product_name = match.group(0)
|
||||||
|
|||||||
Reference in New Issue
Block a user