diff --git a/addons/mrp/report/mrp_report_bom_structure.py b/addons/mrp/report/mrp_report_bom_structure.py index 2f72d7fa4b4..c704db5e9f4 100644 --- a/addons/mrp/report/mrp_report_bom_structure.py +++ b/addons/mrp/report/mrp_report_bom_structure.py @@ -62,6 +62,7 @@ class ReportBomStructure(models.AbstractModel): 'bom_id': bom_id, 'currency': self.env.company.currency_id, 'operations': lines, + 'extra_column_count': self._get_extra_column_count() } return self.env.ref('mrp.report_mrp_operation_line')._render({'data': values}) @@ -99,7 +100,8 @@ class ReportBomStructure(models.AbstractModel): 'bom_uom_name': bom_uom_name, 'bom_qty': bom_quantity, 'is_variant_applied': self.env.user.user_has_groups('product.group_product_variant') and len(bom_product_variants) > 1, - 'is_uom_applied': self.env.user.user_has_groups('uom.group_uom') + 'is_uom_applied': self.env.user.user_has_groups('uom.group_uom'), + 'extra_column_count': self._get_extra_column_count() } def _get_bom(self, bom_id=False, product_id=False, line_qty=False, line_id=False, level=False): @@ -147,6 +149,7 @@ class ReportBomStructure(models.AbstractModel): lines['bom_cost'] = lines['total'] * lines['cost_share'] lines['byproducts_cost'] = sum(byproduct['bom_cost'] for byproduct in byproducts) lines['byproducts_total'] = sum(byproduct['product_qty'] for byproduct in byproducts) + lines['extra_column_count'] = self._get_extra_column_count() return lines def _get_bom_lines(self, bom, bom_quantity, product, line_id, level): @@ -326,4 +329,8 @@ class ReportBomStructure(models.AbstractModel): pdf_lines = get_sub_lines(bom, product_id, qty, False, 1) data['components'] = [] data['lines'] = pdf_lines + data['extra_column_count'] = self._get_extra_column_count() return data + + def _get_extra_column_count(self): + return 0 diff --git a/addons/mrp/report/mrp_report_bom_structure.xml b/addons/mrp/report/mrp_report_bom_structure.xml index f8be4e3db99..87a6facd2fd 100644 --- a/addons/mrp/report/mrp_report_bom_structure.xml +++ b/addons/mrp/report/mrp_report_bom_structure.xml @@ -62,6 +62,9 @@ + + + @@ -77,6 +80,9 @@ + + + @@ -150,6 +156,9 @@ Operations + + + @@ -170,6 +179,9 @@ By-Products + + + @@ -192,6 +204,9 @@ + + + @@ -215,6 +230,9 @@ + + +