diff --git a/plm/__manifest__.py b/plm/__manifest__.py index bb52f256..56e7b930 100644 --- a/plm/__manifest__.py +++ b/plm/__manifest__.py @@ -77,6 +77,8 @@ "web.assets_backend": [ "plm/static/src/css/component_kanban.css", "plm/static/src/css/color_fields_tree.css", + "plm/static/src/js/mrp_bom_overview_line.js", + "plm/static/src/xml/mrp_bom_overview_table_inherit.xml", ], 'web.report_assets_common': [ "plm/static/src/scss/document_bom.scss", diff --git a/plm/report/__init__.py b/plm/report/__init__.py index 3b3638d4..af1c9753 100755 --- a/plm/report/__init__.py +++ b/plm/report/__init__.py @@ -23,7 +23,8 @@ from . import bom_document from . import product_report_document from . import bom_structure +from . import mrp_report_bom_structure -#import new_reports # To Delete when reports are working \ No newline at end of file +#import new_reports # To Delete when reports are working diff --git a/plm/report/mrp_report_bom_structure.py b/plm/report/mrp_report_bom_structure.py new file mode 100644 index 00000000..ffc59e45 --- /dev/null +++ b/plm/report/mrp_report_bom_structure.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +from odoo import models + + +class ReportBomStructure(models.AbstractModel): + _inherit = 'report.mrp.report_bom_structure' + + def _get_component_data(self, parent_bom, parent_product, warehouse, bom_line, line_quantity, level, index, + product_info, ignore_stock=False): + + res = super()._get_component_data(parent_bom, parent_product, warehouse, bom_line, line_quantity, level, index, + product_info, ignore_stock) + res['image_component']= bom_line.product_id.image_1920 + + return res diff --git a/plm/static/src/js/mrp_bom_overview_line.js b/plm/static/src/js/mrp_bom_overview_line.js new file mode 100644 index 00000000..c1f9e2c6 --- /dev/null +++ b/plm/static/src/js/mrp_bom_overview_line.js @@ -0,0 +1,14 @@ +/** @odoo-module */ + +import { patch } from "@web/core/utils/patch"; +import { BomOverviewLine } from "@mrp/components/bom_overview_line/mrp_bom_overview_line"; + +patch(BomOverviewLine.prototype, { + setup() { + super.setup(); + this.image_data = false; + if(this.data && this.data.image_component){ + this.image_data = 'data:image/png;base64, ' + this.data.image_component + } + } +}); diff --git a/plm/static/src/xml/mrp_bom_overview_table_inherit.xml b/plm/static/src/xml/mrp_bom_overview_table_inherit.xml new file mode 100644 index 00000000..52b0a389 --- /dev/null +++ b/plm/static/src/xml/mrp_bom_overview_table_inherit.xml @@ -0,0 +1,18 @@ + + + + + Image + + + + + + + + + + + + +