Skip to content
Snippets Groups Projects
Commit 201a1664 authored by Nans Lefebvre's avatar Nans Lefebvre
Browse files

[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
parent aecfd1a3
Branches
Tags
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment