From 201a1664b2db28baf32f3bf71d776f18d331daf7 Mon Sep 17 00:00:00 2001 From: Nans Lefebvre Date: Mon, 28 Jan 2019 10:33:56 +0000 Subject: [PATCH] [FIX] mrp: use the true level in BoM structure report The BoM structure report is recursive, since product X might use a product X.Y, itself built using a BoM that uses X.Y.Z, and so on. To avoid breaking the layout in cases with too deep nestedness, the report returned a level bounded by 6. This is a totally arbitrary value: the layout can be broken not only because of nestedness, but also because of the length of the product name. So it doesn't really solve the problem. Moreover, a presentation problem should be solved at the presentation layer, which is CSS. opw 1921011 closes odoo/odoo#30606 --- addons/mrp/report/mrp_bom_structure_report.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/mrp/report/mrp_bom_structure_report.py b/addons/mrp/report/mrp_bom_structure_report.py index c497d562f89..88ac30ed1f9 100644 --- a/addons/mrp/report/mrp_bom_structure_report.py +++ b/addons/mrp/report/mrp_bom_structure_report.py @@ -42,10 +42,9 @@ class BomStructureReport(models.AbstractModel): child = self._get_child_vals(l, level, qty, uom) result.append(child) if l.child_line_ids: - if level < 6: - level += 1 + level += 1 _get_rec(l.child_line_ids, level, qty=child['pqty'], uom=child['puom']) - if level > 0 and level < 6: + if level > 0: level -= 1 return result