diff --git a/sf_manufacturing/models/purchase_order.py b/sf_manufacturing/models/purchase_order.py index 7b460958..039dfee5 100644 --- a/sf_manufacturing/models/purchase_order.py +++ b/sf_manufacturing/models/purchase_order.py @@ -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 \ No newline at end of file + record.part_name = record.manual_part_name + if record.manual_part_number: + record.part_number = record.manual_part_number \ No newline at end of file diff --git a/sf_sale/models/sale_order.py b/sf_sale/models/sale_order.py index 49a3e48c..b3c058ae 100644 --- a/sf_sale/models/sale_order.py +++ b/sf_sale/models/sale_order.py @@ -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, })) # 获取服务商品最后一个供应商的采购员