diff options
| author | Nans Lefebvre <len@odoo.com> | 2019-01-28 10:33:56 +0000 |
|---|---|---|
| committer | Nans Lefebvre <len@odoo.com> | 2019-01-28 10:38:35 +0000 |
| commit | 201a1664b2db28baf32f3bf71d776f18d331daf7 (patch) | |
| tree | 8ea9cb748da573e8bfcd47af26ad1f384633b69d | |
| parent | aecfd1a3077a1f0abf8d95823cb2457f9c6d7ac1 (diff) | |
[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
| -rw-r--r-- | addons/mrp/report/mrp_bom_structure_report.py | 5 |
1 files 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 |
