diff --git a/mrp_flattened_bom_xlsx_labour_cost/README.rst b/mrp_flattened_bom_xlsx_labour_cost/README.rst new file mode 100644 index 00000000..badbd166 --- /dev/null +++ b/mrp_flattened_bom_xlsx_labour_cost/README.rst @@ -0,0 +1,91 @@ +============================================== +Export Flattened BOM to Excel with labour cost +============================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:b61b875bcc8c05c4d44521d414ac630adb1760e1cf283f6b002c82e97fb25ae0 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmanufacture--reporting-lightgray.png?logo=github + :target: https://github.com/OCA/manufacture-reporting/tree/18.0/mrp_flattened_bom_xlsx_labour_cost + :alt: OCA/manufacture-reporting +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/manufacture-reporting-18-0/manufacture-reporting-18-0-mrp_flattened_bom_xlsx_labour_cost + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/manufacture-reporting&target_branch=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module extends the report of the Export Flattened BOM to Excel +module with a new tab showing the labour costs. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To use this module, you need to: + +1. Go to 'Manufacturing / Products / Bill of Materials' + +2. Select a BOM or more BOMS + + *(Could be interesting to modify quantities of these BOMs)* + +3. Go to 'Print / Export Flattened BOM Structure to Excel'. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* ForgeFlow + +Contributors +------------ + +- Bernat Puig Font +- Thinh Banh + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/manufacture-reporting `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/mrp_flattened_bom_xlsx_labour_cost/__init__.py b/mrp_flattened_bom_xlsx_labour_cost/__init__.py new file mode 100644 index 00000000..bf588bc8 --- /dev/null +++ b/mrp_flattened_bom_xlsx_labour_cost/__init__.py @@ -0,0 +1,2 @@ +from . import models +from . import report diff --git a/mrp_flattened_bom_xlsx_labour_cost/__manifest__.py b/mrp_flattened_bom_xlsx_labour_cost/__manifest__.py new file mode 100644 index 00000000..cea67be5 --- /dev/null +++ b/mrp_flattened_bom_xlsx_labour_cost/__manifest__.py @@ -0,0 +1,13 @@ +# Copyright 2022 ForgeFlow S.L. (http://www.forgeflow.com) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +{ + "name": "Export Flattened BOM to Excel with labour cost", + "version": "18.0.1.0.0", + "category": "Manufacturing", + "author": "ForgeFlow, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/manufacture-reporting", + "license": "AGPL-3", + "depends": ["mrp_flattened_bom_xlsx_direct_materials_cost", "mrp"], + "installable": True, +} diff --git a/mrp_flattened_bom_xlsx_labour_cost/i18n/it.po b/mrp_flattened_bom_xlsx_labour_cost/i18n/it.po new file mode 100644 index 00000000..f81be14d --- /dev/null +++ b/mrp_flattened_bom_xlsx_labour_cost/i18n/it.po @@ -0,0 +1,136 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_flattened_bom_xlsx_labour_cost +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-07-25 12:11+0000\n" +"Last-Translator: Francesco Foresti \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: mrp_flattened_bom_xlsx_labour_cost +#: model:ir.model,name:mrp_flattened_bom_xlsx_labour_cost.model_mrp_bom +msgid "Bill of Material" +msgstr "Distinta base" + +#. module: mrp_flattened_bom_xlsx_labour_cost +#: code:addons/mrp_flattened_bom_xlsx_labour_cost/report/flattened_bom_xlsx.py:0 +#, python-format +msgid "Cost per hour" +msgstr "Costo per ora" + +#. module: mrp_flattened_bom_xlsx_labour_cost +#: code:addons/mrp_flattened_bom_xlsx_labour_cost/report/flattened_bom_xlsx.py:0 +#, python-format +msgid "Currency" +msgstr "Valuta" + +#. module: mrp_flattened_bom_xlsx_labour_cost +#: model:ir.model.fields,field_description:mrp_flattened_bom_xlsx_labour_cost.field_mrp_bom__display_name +#: model:ir.model.fields,field_description:mrp_flattened_bom_xlsx_labour_cost.field_report_mrp_flattened_bom_xlsx_flattened_bom_xlsx__display_name +msgid "Display Name" +msgstr "Nome visualizzato" + +#. module: mrp_flattened_bom_xlsx_labour_cost +#: code:addons/mrp_flattened_bom_xlsx_labour_cost/report/flattened_bom_xlsx.py:0 +#, python-format +msgid "Duration (hours)" +msgstr "Durata (ore)" + +#. module: mrp_flattened_bom_xlsx_labour_cost +#: model:ir.model,name:mrp_flattened_bom_xlsx_labour_cost.model_report_mrp_flattened_bom_xlsx_flattened_bom_xlsx +msgid "Flattened BOM XLSX" +msgstr "XLSX distinta base tecnica" + +#. module: mrp_flattened_bom_xlsx_labour_cost +#: model:ir.model.fields,field_description:mrp_flattened_bom_xlsx_labour_cost.field_mrp_bom__id +#: model:ir.model.fields,field_description:mrp_flattened_bom_xlsx_labour_cost.field_report_mrp_flattened_bom_xlsx_flattened_bom_xlsx__id +msgid "ID" +msgstr "ID" + +#. module: mrp_flattened_bom_xlsx_labour_cost +#: code:addons/mrp_flattened_bom_xlsx_labour_cost/report/flattened_bom_xlsx.py:0 +#, python-format +msgid "Internal Reference" +msgstr "Riferimento interno" + +#. module: mrp_flattened_bom_xlsx_labour_cost +#: code:addons/mrp_flattened_bom_xlsx_labour_cost/report/flattened_bom_xlsx.py:0 +#: model:ir.model.fields,field_description:mrp_flattened_bom_xlsx_labour_cost.field_mrp_bom__labour_cost +#, python-format +msgid "Labour Cost" +msgstr "Costo manodopera" + +#. module: mrp_flattened_bom_xlsx_labour_cost +#: code:addons/mrp_flattened_bom_xlsx_labour_cost/report/flattened_bom_xlsx.py:0 +#, python-format +msgid "Labour Costs" +msgstr "Costi manodopera" + +#. module: mrp_flattened_bom_xlsx_labour_cost +#: code:addons/mrp_flattened_bom_xlsx_labour_cost/report/flattened_bom_xlsx.py:0 +#, python-format +msgid "Labour Unit Cost" +msgstr "Costo unitario manodopera" + +#. module: mrp_flattened_bom_xlsx_labour_cost +#: model:ir.model.fields,field_description:mrp_flattened_bom_xlsx_labour_cost.field_mrp_bom____last_update +#: model:ir.model.fields,field_description:mrp_flattened_bom_xlsx_labour_cost.field_report_mrp_flattened_bom_xlsx_flattened_bom_xlsx____last_update +msgid "Last Modified on" +msgstr "Ultima modifica il" + +#. module: mrp_flattened_bom_xlsx_labour_cost +#: code:addons/mrp_flattened_bom_xlsx_labour_cost/report/flattened_bom_xlsx.py:0 +#, python-format +msgid "Level" +msgstr "Livello" + +#. module: mrp_flattened_bom_xlsx_labour_cost +#: code:addons/mrp_flattened_bom_xlsx_labour_cost/report/flattened_bom_xlsx.py:0 +#, python-format +msgid "Main BOM" +msgstr "DiBa principale" + +#. module: mrp_flattened_bom_xlsx_labour_cost +#: code:addons/mrp_flattened_bom_xlsx_labour_cost/report/flattened_bom_xlsx.py:0 +#, python-format +msgid "Operation" +msgstr "Operazione" + +#. module: mrp_flattened_bom_xlsx_labour_cost +#: code:addons/mrp_flattened_bom_xlsx_labour_cost/report/flattened_bom_xlsx.py:0 +#, python-format +msgid "Product Name" +msgstr "Nome prodotto" + +#. module: mrp_flattened_bom_xlsx_labour_cost +#: code:addons/mrp_flattened_bom_xlsx_labour_cost/report/flattened_bom_xlsx.py:0 +#, python-format +msgid "Quantity" +msgstr "Quantità" + +#. module: mrp_flattened_bom_xlsx_labour_cost +#: code:addons/mrp_flattened_bom_xlsx_labour_cost/report/flattened_bom_xlsx.py:0 +#, python-format +msgid "Sub BOMs" +msgstr "DiBa sottostanti" + +#. module: mrp_flattened_bom_xlsx_labour_cost +#: code:addons/mrp_flattened_bom_xlsx_labour_cost/report/flattened_bom_xlsx.py:0 +#, python-format +msgid "Unit of Measure" +msgstr "Unità di misura" + +#. module: mrp_flattened_bom_xlsx_labour_cost +#: code:addons/mrp_flattened_bom_xlsx_labour_cost/report/flattened_bom_xlsx.py:0 +#, python-format +msgid "Work Center" +msgstr "Centro di lavoro" diff --git a/mrp_flattened_bom_xlsx_labour_cost/i18n/mrp_flattened_bom_xlsx_labour_cost.pot b/mrp_flattened_bom_xlsx_labour_cost/i18n/mrp_flattened_bom_xlsx_labour_cost.pot new file mode 100644 index 00000000..4eef4401 --- /dev/null +++ b/mrp_flattened_bom_xlsx_labour_cost/i18n/mrp_flattened_bom_xlsx_labour_cost.pot @@ -0,0 +1,130 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_flattened_bom_xlsx_labour_cost +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: mrp_flattened_bom_xlsx_labour_cost +#: model:ir.model,name:mrp_flattened_bom_xlsx_labour_cost.model_mrp_bom +msgid "Bill of Material" +msgstr "" + +#. module: mrp_flattened_bom_xlsx_labour_cost +#. odoo-python +#: code:addons/mrp_flattened_bom_xlsx_labour_cost/report/flattened_bom_xlsx.py:0 +#, python-format +msgid "Cost per hour" +msgstr "" + +#. module: mrp_flattened_bom_xlsx_labour_cost +#. odoo-python +#: code:addons/mrp_flattened_bom_xlsx_labour_cost/report/flattened_bom_xlsx.py:0 +#, python-format +msgid "Currency" +msgstr "" + +#. module: mrp_flattened_bom_xlsx_labour_cost +#. odoo-python +#: code:addons/mrp_flattened_bom_xlsx_labour_cost/report/flattened_bom_xlsx.py:0 +#, python-format +msgid "Duration (hours)" +msgstr "" + +#. module: mrp_flattened_bom_xlsx_labour_cost +#: model:ir.model,name:mrp_flattened_bom_xlsx_labour_cost.model_report_mrp_flattened_bom_xlsx_flattened_bom_xlsx +msgid "Flattened BOM XLSX" +msgstr "" + +#. module: mrp_flattened_bom_xlsx_labour_cost +#. odoo-python +#: code:addons/mrp_flattened_bom_xlsx_labour_cost/report/flattened_bom_xlsx.py:0 +#, python-format +msgid "Internal Reference" +msgstr "" + +#. module: mrp_flattened_bom_xlsx_labour_cost +#. odoo-python +#: code:addons/mrp_flattened_bom_xlsx_labour_cost/report/flattened_bom_xlsx.py:0 +#: model:ir.model.fields,field_description:mrp_flattened_bom_xlsx_labour_cost.field_mrp_bom__labour_cost +#, python-format +msgid "Labour Cost" +msgstr "" + +#. module: mrp_flattened_bom_xlsx_labour_cost +#. odoo-python +#: code:addons/mrp_flattened_bom_xlsx_labour_cost/report/flattened_bom_xlsx.py:0 +#, python-format +msgid "Labour Costs" +msgstr "" + +#. module: mrp_flattened_bom_xlsx_labour_cost +#. odoo-python +#: code:addons/mrp_flattened_bom_xlsx_labour_cost/report/flattened_bom_xlsx.py:0 +#, python-format +msgid "Labour Unit Cost" +msgstr "" + +#. module: mrp_flattened_bom_xlsx_labour_cost +#. odoo-python +#: code:addons/mrp_flattened_bom_xlsx_labour_cost/report/flattened_bom_xlsx.py:0 +#, python-format +msgid "Level" +msgstr "" + +#. module: mrp_flattened_bom_xlsx_labour_cost +#. odoo-python +#: code:addons/mrp_flattened_bom_xlsx_labour_cost/report/flattened_bom_xlsx.py:0 +#, python-format +msgid "Main BOM" +msgstr "" + +#. module: mrp_flattened_bom_xlsx_labour_cost +#. odoo-python +#: code:addons/mrp_flattened_bom_xlsx_labour_cost/report/flattened_bom_xlsx.py:0 +#, python-format +msgid "Operation" +msgstr "" + +#. module: mrp_flattened_bom_xlsx_labour_cost +#. odoo-python +#: code:addons/mrp_flattened_bom_xlsx_labour_cost/report/flattened_bom_xlsx.py:0 +#, python-format +msgid "Product Name" +msgstr "" + +#. module: mrp_flattened_bom_xlsx_labour_cost +#. odoo-python +#: code:addons/mrp_flattened_bom_xlsx_labour_cost/report/flattened_bom_xlsx.py:0 +#, python-format +msgid "Quantity" +msgstr "" + +#. module: mrp_flattened_bom_xlsx_labour_cost +#. odoo-python +#: code:addons/mrp_flattened_bom_xlsx_labour_cost/report/flattened_bom_xlsx.py:0 +#, python-format +msgid "Sub BOMs" +msgstr "" + +#. module: mrp_flattened_bom_xlsx_labour_cost +#. odoo-python +#: code:addons/mrp_flattened_bom_xlsx_labour_cost/report/flattened_bom_xlsx.py:0 +#, python-format +msgid "Unit of Measure" +msgstr "" + +#. module: mrp_flattened_bom_xlsx_labour_cost +#. odoo-python +#: code:addons/mrp_flattened_bom_xlsx_labour_cost/report/flattened_bom_xlsx.py:0 +#, python-format +msgid "Work Center" +msgstr "" diff --git a/mrp_flattened_bom_xlsx_labour_cost/models/__init__.py b/mrp_flattened_bom_xlsx_labour_cost/models/__init__.py new file mode 100644 index 00000000..a352efe9 --- /dev/null +++ b/mrp_flattened_bom_xlsx_labour_cost/models/__init__.py @@ -0,0 +1 @@ +from . import mrp_bom diff --git a/mrp_flattened_bom_xlsx_labour_cost/models/mrp_bom.py b/mrp_flattened_bom_xlsx_labour_cost/models/mrp_bom.py new file mode 100644 index 00000000..882682c9 --- /dev/null +++ b/mrp_flattened_bom_xlsx_labour_cost/models/mrp_bom.py @@ -0,0 +1,19 @@ +# Copyright 2022 ForgeFlow S.L. +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class MrpBom(models.Model): + _inherit = "mrp.bom" + + labour_cost = fields.Float(compute="_compute_labour_cost", digits="Product Price") + + def _compute_labour_cost(self): + for bom in self: + cost = 0.0 + for operation in bom.operation_ids: + cost += operation.workcenter_id.costs_hour * ( + operation.time_cycle / 60.0 + ) + bom.labour_cost = cost diff --git a/mrp_flattened_bom_xlsx_labour_cost/pyproject.toml b/mrp_flattened_bom_xlsx_labour_cost/pyproject.toml new file mode 100644 index 00000000..4231d0cc --- /dev/null +++ b/mrp_flattened_bom_xlsx_labour_cost/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/mrp_flattened_bom_xlsx_labour_cost/readme/CONTRIBUTORS.md b/mrp_flattened_bom_xlsx_labour_cost/readme/CONTRIBUTORS.md new file mode 100644 index 00000000..240090e0 --- /dev/null +++ b/mrp_flattened_bom_xlsx_labour_cost/readme/CONTRIBUTORS.md @@ -0,0 +1,2 @@ +- Bernat Puig Font \ +- Thinh Banh \ diff --git a/mrp_flattened_bom_xlsx_labour_cost/readme/DESCRIPTION.md b/mrp_flattened_bom_xlsx_labour_cost/readme/DESCRIPTION.md new file mode 100644 index 00000000..70b63a08 --- /dev/null +++ b/mrp_flattened_bom_xlsx_labour_cost/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +This module extends the report of the Export Flattened BOM to Excel +module with a new tab showing the labour costs. diff --git a/mrp_flattened_bom_xlsx_labour_cost/readme/USAGE.md b/mrp_flattened_bom_xlsx_labour_cost/readme/USAGE.md new file mode 100644 index 00000000..0d4a0639 --- /dev/null +++ b/mrp_flattened_bom_xlsx_labour_cost/readme/USAGE.md @@ -0,0 +1,9 @@ +To use this module, you need to: + +1. Go to 'Manufacturing / Products / Bill of Materials' + +2. Select a BOM or more BOMS + + *(Could be interesting to modify quantities of these BOMs)* + +3. Go to 'Print / Export Flattened BOM Structure to Excel'. diff --git a/mrp_flattened_bom_xlsx_labour_cost/report/__init__.py b/mrp_flattened_bom_xlsx_labour_cost/report/__init__.py new file mode 100644 index 00000000..06df3655 --- /dev/null +++ b/mrp_flattened_bom_xlsx_labour_cost/report/__init__.py @@ -0,0 +1,2 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +from . import flattened_bom_xlsx diff --git a/mrp_flattened_bom_xlsx_labour_cost/report/flattened_bom_xlsx.py b/mrp_flattened_bom_xlsx_labour_cost/report/flattened_bom_xlsx.py new file mode 100644 index 00000000..0d2a69c1 --- /dev/null +++ b/mrp_flattened_bom_xlsx_labour_cost/report/flattened_bom_xlsx.py @@ -0,0 +1,108 @@ +# Copyright 2022 ForgeFlow S.L. (http://www.forgeflow.com) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +import logging +from collections import OrderedDict + +from odoo import models + +_logger = logging.getLogger(__name__) + + +class FlattenedBomXlsx(models.AbstractModel): + _inherit = "report.mrp_flattened_bom_xlsx.flattened_bom_xlsx" + + def _get_bom_operation_values(self, bom, operation, qty): + labour_cost = operation.workcenter_id.costs_hour * (operation.time_cycle / 60.0) + return [ + bom.product_tmpl_id.name or "", + bom.product_tmpl_id.default_code or "", + bom.display_name or "", + operation.name or "", + operation.workcenter_id.name or "", + qty, + bom.product_tmpl_id.uom_id.name or "", + operation.time_cycle / 60.0 or 0.0, + operation.workcenter_id.costs_hour or 0.0, + labour_cost or 0.0, + labour_cost * qty or 0.0, + bom.product_tmpl_id.currency_id.symbol or "", + ] + + def _print_bom_lines_labour(self, bom, llc, qty, sheet, row, n_columns): + for operation in bom.operation_ids: + sheet.write(row, 0, llc) + values = self._get_bom_operation_values(bom, operation, qty) + for j in range(2, n_columns): + sheet.write(row, j, values[j - 2]) + if llc == 0: + sheet.write(row, 1, bom.product_tmpl_id.name or "") + row += 1 + return row + + def _get_bom_structure_dict(self, boms, bom, llc, qty): + """ + Return BoM structure without last level of materials. + :returns: dict: keys are BoM identifiers and values + are [llc, qty] objects. + """ + boms[bom.id] = [llc, qty] + for line in bom.bom_line_ids: + if line.product_id.bom_ids: + boms = self._get_bom_structure_dict( + boms, line.product_id.bom_ids[0], llc + 1, qty * line.product_qty + ) + return boms + + def _get_labour_title_values(self): + return [ + self.env._("Level"), + self.env._("Main BOM"), + self.env._("Sub BOMs"), + self.env._("Internal Reference"), + self.env._("Product Name"), + self.env._("Operation"), + self.env._("Work Center"), + self.env._("Quantity"), + self.env._("Unit of Measure"), + self.env._("Duration (hours)"), + self.env._("Cost per hour"), + self.env._("Labour Unit Cost"), + self.env._("Labour Cost"), + self.env._("Currency"), + ] + + def _generate_xlsx_labour_sheet_format(self, sheet): + sheet.set_landscape() + sheet.fit_to_pages(1, 0) + sheet.set_zoom(80) + sheet.set_column(0, 0, 5) + sheet.set_column(1, 6, 20) + sheet.set_column(7, 13, 15) + + def generate_xlsx_report(self, workbook, data, objects): + res = super().generate_xlsx_report(workbook, data, objects) + sheet = workbook.add_worksheet(self.env._("Labour Costs")) + + self._generate_xlsx_labour_sheet_format(sheet) + title_style = workbook.add_format( + {"bold": True, "bg_color": "#FFFFCC", "bottom": 1} + ) + sheet_title = self._get_labour_title_values() + sheet.set_row(0, None, None, {"collapsed": 1}) + sheet.write_row(1, 0, sheet_title, title_style) + sheet.freeze_panes(2, 0) + n_columns = len(sheet_title) + + i = 2 + bom_model = self.env["mrp.bom"] + for o in objects: + boms = {} + boms = self._get_bom_structure_dict(boms, o, 0, 1.0) + for key in OrderedDict(sorted(boms.items(), key=lambda x: x[1][0])): + bom = bom_model.browse(key) + llc = boms[key][0] + qty = boms[key][1] + i = self._print_bom_lines_labour(bom, llc, qty, sheet, i, n_columns) + + return res diff --git a/mrp_flattened_bom_xlsx_labour_cost/static/description/icon.png b/mrp_flattened_bom_xlsx_labour_cost/static/description/icon.png new file mode 100644 index 00000000..3a0328b5 Binary files /dev/null and b/mrp_flattened_bom_xlsx_labour_cost/static/description/icon.png differ diff --git a/mrp_flattened_bom_xlsx_labour_cost/static/description/index.html b/mrp_flattened_bom_xlsx_labour_cost/static/description/index.html new file mode 100644 index 00000000..7d6cf1f2 --- /dev/null +++ b/mrp_flattened_bom_xlsx_labour_cost/static/description/index.html @@ -0,0 +1,439 @@ + + + + + +Export Flattened BOM to Excel with labour cost + + + +
+

Export Flattened BOM to Excel with labour cost

+ + +

Beta License: AGPL-3 OCA/manufacture-reporting Translate me on Weblate Try me on Runboat

+

This module extends the report of the Export Flattened BOM to Excel +module with a new tab showing the labour costs.

+

Table of contents

+ +
+

Usage

+

To use this module, you need to:

+
    +
  1. Go to ‘Manufacturing / Products / Bill of Materials’

    +
  2. +
  3. Select a BOM or more BOMS

    +

    (Could be interesting to modify quantities of these BOMs)

    +
  4. +
  5. Go to ‘Print / Export Flattened BOM Structure to Excel’.

    +
  6. +
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • ForgeFlow
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/manufacture-reporting project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 00000000..14023762 --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1 @@ +odoo-addon-mrp_flattened_bom_xlsx_direct_materials_cost @ git+https://github.com/Thinh240900/manufacture-reporting.git@refs/pull/1/head#subdirectory=mrp_flattened_bom_xlsx_direct_materials_cost