From c43e39ce92c52b22e37a5c402569c8522b8bfb42 Mon Sep 17 00:00:00 2001 From: clesgow Date: Wed, 8 Mar 2023 14:24:27 +0000 Subject: [PATCH] [FIX] mrp: fix missing uom for operations/byproducts in BoM Overview Wrong key was used to display the unit of measure in the BoM Overview, leaving the cells empty. closes odoo/odoo#114934 X-original-commit: a6eba909a8f2ab07ddb239b4b64e82d51f724e66 Signed-off-by: Arnold Moyaux (arm) Signed-off-by: Quentin Wolfs (quwo) --- addons/mrp/report/mrp_report_bom_structure.py | 6 +++--- addons/mrp/report/mrp_report_bom_structure.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/mrp/report/mrp_report_bom_structure.py b/addons/mrp/report/mrp_report_bom_structure.py index f9748d9e73a..51cd6b9d750 100644 --- a/addons/mrp/report/mrp_report_bom_structure.py +++ b/addons/mrp/report/mrp_report_bom_structure.py @@ -328,7 +328,7 @@ class ReportBomStructure(models.AbstractModel): 'currency_id': company.currency_id.id, 'name': byproduct.product_id.display_name, 'quantity': line_quantity, - 'uom': byproduct.product_uom_id.name, + 'uom_name': byproduct.product_uom_id.name, 'prod_cost': company.currency_id.round(price), 'parent_id': bom.id, 'level': level or 0, @@ -360,7 +360,7 @@ class ReportBomStructure(models.AbstractModel): 'link_id': operation.id, 'link_model': 'mrp.routing.workcenter', 'name': operation.name + ' - ' + operation.workcenter_id.name, - 'uom': _("Minutes"), + 'uom_name': _("Minutes"), 'quantity': duration_expected, 'bom_cost': self.env.company.currency_id.round(total), 'currency_id': company.currency_id.id, @@ -459,7 +459,7 @@ class ReportBomStructure(models.AbstractModel): 'name': byproduct['name'], 'type': 'byproduct', 'quantity': byproduct['quantity'], - 'uom': byproduct['uom'], + 'uom': byproduct['uom_name'], 'prod_cost': byproduct['prod_cost'], 'bom_cost': byproduct['bom_cost'], 'level': level + 1, diff --git a/addons/mrp/report/mrp_report_bom_structure.xml b/addons/mrp/report/mrp_report_bom_structure.xml index c222540fe67..84f5ff5c243 100644 --- a/addons/mrp/report/mrp_report_bom_structure.xml +++ b/addons/mrp/report/mrp_report_bom_structure.xml @@ -72,7 +72,7 @@ Unit Cost - +