Accept Merge Request #1919: (feature/tool_standard_library_process -> develop)

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

Created By: @廖丹龙
Reviewed By: @胡尧
Approved By: @胡尧 
Accepted By: @廖丹龙
URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1919
This commit is contained in:
廖丹龙
2025-03-18 11:27:43 +08:00
committed by Coding
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