From 5e998efe5e42bd87ce6e5c898cc582f3eea73054 Mon Sep 17 00:00:00 2001 From: "Touati Djamel (otd)" Date: Mon, 5 Jul 2021 13:32:26 +0000 Subject: [PATCH] [FIX] mrp: fix BOM structure & cost MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Steps to reproduce the bug: - Install manufacturing app - Create a product “A” - Create a Bill of Materials for product A > add any product > save - Create another Product “B” > Create a BOM and add the product “A” in quantity “0” > save - Click on “BOM Structure & Cost” for product “B” > open the sublevel BOM dropdown of the product “A” Problem: An error is triggered because the quantity of the product is "None" opw-2585033 closes odoo/odoo#73323 X-original-commit: 06c172746f2d2dc8235c6e607342506bf9ef1551 Signed-off-by: Anh Thao PHAM Signed-off-by: Djamel Touati --- addons/mrp/report/mrp_report_bom_structure.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp/report/mrp_report_bom_structure.py b/addons/mrp/report/mrp_report_bom_structure.py index 515fc1cc76b..a726e342751 100644 --- a/addons/mrp/report/mrp_report_bom_structure.py +++ b/addons/mrp/report/mrp_report_bom_structure.py @@ -96,7 +96,7 @@ class ReportBomStructure(models.AbstractModel): bom_quantity = line_qty if line_id: current_line = self.env['mrp.bom.line'].browse(int(line_id)) - bom_quantity = current_line.product_uom_id._compute_quantity(line_qty, bom.product_uom_id) + bom_quantity = current_line.product_uom_id._compute_quantity(line_qty, bom.product_uom_id) or 0 # Display bom components for current selected product variant if product_id: product = self.env['product.product'].browse(int(product_id))