From 85ada6ff6dada1bd90867c73d1da516f3ec9706c Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Thu, 31 Jan 2019 12:03:44 +0000 Subject: [PATCH] [FIX] mrp: PDF of BoM structure - Create the following BOM for 1 Unit of A: B: 55 Units - Create the following BOM for 728 Units of B: C: 1 Unit - Create the following BOM for 1 Unit of C: D: 728 Units - Go to 'BoM Structure & Cost' of A: A: 1 Unit B: 55 Units C: 0.0755 Units D: 58.24 Units - Print Unfolded: A: 1 Unit B: 55 Units C: 0.0755 Units D: 40040 Units The unfolded PDF structure is incorrect. The reference quantity taken into account to compute the BoM subline should be the quantity on the line, not the quantity on the parent line. opw-1915546 closes odoo/odoo#30726 --- 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 3c3a49eb1d2..e18c20d39ec 100644 --- a/addons/mrp/report/mrp_report_bom_structure.py +++ b/addons/mrp/report/mrp_report_bom_structure.py @@ -225,7 +225,7 @@ class ReportBomStructure(models.AbstractModel): }) if bom_line['child_bom'] and (unfolded or bom_line['child_bom'] in child_bom_ids): line = self.env['mrp.bom.line'].browse(bom_line['line_id']) - lines += (get_sub_lines(line.child_bom_id, line.product_id, line.product_qty * data['bom_qty'], line, level + 1)) + lines += (get_sub_lines(line.child_bom_id, line.product_id, bom_line['prod_qty'], line, level + 1)) if data['operations']: lines.append({ 'name': _('Operations'),