diff --git a/addons/mrp/report/mrp_report_bom_structure.py b/addons/mrp/report/mrp_report_bom_structure.py index b9108828b37..cb6f598fef9 100644 --- a/addons/mrp/report/mrp_report_bom_structure.py +++ b/addons/mrp/report/mrp_report_bom_structure.py @@ -208,8 +208,6 @@ class ReportBomStructure(models.AbstractModel): def _get_pdf_line(self, bom_id, product_id=False, qty=1, child_bom_ids=[], unfolded=False): - data = self._get_bom(bom_id=bom_id, product_id=product_id.id, line_qty=qty) - def get_sub_lines(bom, product_id, line_qty, line_id, level): data = self._get_bom(bom_id=bom.id, product_id=product_id.id, line_qty=line_qty, line_id=line_id, level=level) bom_lines = data['components'] @@ -253,6 +251,7 @@ class ReportBomStructure(models.AbstractModel): bom = self.env['mrp.bom'].browse(bom_id) product = product_id or bom.product_id or bom.product_tmpl_id.product_variant_id + data = self._get_bom(bom_id=bom_id, product_id=product.id, line_qty=qty) pdf_lines = get_sub_lines(bom, product, qty, False, 1) data['components'] = [] data['lines'] = pdf_lines