From 5646476dbf74ff0252cfe9a6965497c6363fc0ee Mon Sep 17 00:00:00 2001 From: "Touati Djamel (otd)" Date: Fri, 19 Nov 2021 11:43:37 +0000 Subject: [PATCH] [FIX] mrp: improve mrp BOM report Steps to reproduce the bug: - Create a BOM: - set the quantity of the finished product and component as more than 1 - save > print > BOM Structure Problem: The report generated shows the qty and cost for production of 1 unit of product, regardless of the BOM quantity opw-2691632 closes odoo/odoo#80145 X-original-commit: d08b0abd56a04a23e155b345bf1796a031321f2f Signed-off-by: William Henrotin (whe) Signed-off-by: Djamel Touati (otd) --- 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 d57d2bf6d90..d6531fdb5d9 100644 --- a/addons/mrp/report/mrp_report_bom_structure.py +++ b/addons/mrp/report/mrp_report_bom_structure.py @@ -16,7 +16,7 @@ class ReportBomStructure(models.AbstractModel): bom = self.env['mrp.bom'].browse(bom_id) variant = data.get('variant') candidates = variant and self.env['product.product'].browse(variant) or bom.product_id or bom.product_tmpl_id.product_variant_ids - quantity = float(data.get('quantity', 1)) + quantity = float(data.get('quantity', bom.product_qty)) for product_variant_id in candidates.ids: if data and data.get('childs'): doc = self._get_pdf_line(bom_id, product_id=product_variant_id, qty=quantity, child_bom_ids=set(json.loads(data.get('childs'))))