From 3642398724af7b05a9560f0fc7ba6245a01e5375 Mon Sep 17 00:00:00 2001 From: liaodanlong Date: Tue, 18 Mar 2025 11:25:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A8=E9=9D=A2=E5=B7=A5=E8=89=BA=E9=9B=B6?= =?UTF-8?q?=E4=BB=B6=E5=9B=BE=E5=8F=B7=E6=B2=A1=E6=9C=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_manufacturing/models/purchase_order.py | 5 ++++- sf_sale/models/sale_order.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) 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, })) # 获取服务商品最后一个供应商的采购员