表面工艺零件图号没有问题

This commit is contained in:
liaodanlong
2025-03-18 11:25:46 +08:00
parent 1311669814
commit 3642398724
2 changed files with 5 additions and 2 deletions

View File

@@ -113,6 +113,7 @@ class PurchaseOrderLine(models.Model):
part_name = fields.Char('零件名称', store=True, compute='_compute_part_name')
related_product = fields.Many2one('product.product', string='关联产品',
help='经此产品工艺加工成的成品')
manual_part_number = fields.Char()
manual_part_name = fields.Char()
@api.depends('product_id')
@@ -143,4 +144,6 @@ class PurchaseOrderLine(models.Model):
record.part_name = record.product_id.part_name
if record.manual_part_name:
# 如果手动设置了 part_name使用手动设置的值
record.part_name = record.manual_part_name
record.part_name = record.manual_part_name
if record.manual_part_number:
record.part_number = record.manual_part_number

View File

@@ -374,7 +374,7 @@ class RePurchaseOrder(models.Model):
'product_qty': 1,
'product_uom': server_template.uom_id.id,
'related_product': production.product_id.id,
'part_number': pp.part_number,
'manual_part_number': pp.part_number,
'manual_part_name': pp.part_name,
}))
# 获取服务商品最后一个供应商的采购员