From fa5307a2ea43412c323a1a4f223ea6ac53c8be3d Mon Sep 17 00:00:00 2001 From: "lixiaobin@jikimo.com" Date: Fri, 11 Jul 2025 11:13:08 +0800 Subject: [PATCH] =?UTF-8?q?7253=5FBUG=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_demand_plan/models/mrp_bom.py | 9 +++++++++ sf_demand_plan/views/demand_plan_info.xml | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/sf_demand_plan/models/mrp_bom.py b/sf_demand_plan/models/mrp_bom.py index 8973cb87..3368653b 100644 --- a/sf_demand_plan/models/mrp_bom.py +++ b/sf_demand_plan/models/mrp_bom.py @@ -18,3 +18,12 @@ class MrpBom(models.Model): subcontract = self.get_supplier(product.materials_type_id) bom_id.subcontractor_id = subcontract.partner_id.id return bom_id + + def name_get(self): + """重写name_get方法,只显示BOM编码""" + result = [] + for record in self: + # 只显示BOM编码,如果编码为空则显示名称 + display_name = record.code or record.name or f'BOM-{record.id}' + result.append((record.id, display_name)) + return result \ No newline at end of file diff --git a/sf_demand_plan/views/demand_plan_info.xml b/sf_demand_plan/views/demand_plan_info.xml index 414e60d1..ea7f5abd 100644 --- a/sf_demand_plan/views/demand_plan_info.xml +++ b/sf_demand_plan/views/demand_plan_info.xml @@ -86,7 +86,7 @@ 'required': [('new_supply_method', '=', 'custom_made')]}"/> - +