Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions mrp_flattened_bom_xlsx_subcontracting_cost/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
======================================================
Export Flattened BOM to Excel with subcontracting cost
======================================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:5175baf02ffbcee9308161d98c5cd57be29128fe847c13dfcd6937097f14dbc1
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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_subcontracting_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_subcontracting_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 subcontracting cost.

**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 <https://github.com/OCA/manufacture-reporting/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 <https://github.com/OCA/manufacture-reporting/issues/new?body=module:%20mrp_flattened_bom_xlsx_subcontracting_cost%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
-------

* ForgeFlow

Contributors
------------

- Bernat Puig Font <[email protected]>

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 <https://github.com/OCA/manufacture-reporting/tree/18.0/mrp_flattened_bom_xlsx_subcontracting_cost>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions mrp_flattened_bom_xlsx_subcontracting_cost/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from . import report
13 changes: 13 additions & 0 deletions mrp_flattened_bom_xlsx_subcontracting_cost/__manifest__.py
Original file line number Diff line number Diff line change
@@ -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 subcontracting 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_subcontracting"],
"installable": True,
}
121 changes: 121 additions & 0 deletions mrp_flattened_bom_xlsx_subcontracting_cost/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mrp_flattened_bom_xlsx_subcontracting_cost
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-05-17 12:34+0000\n"
"Last-Translator: mymage <[email protected]>\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.14.1\n"

#. module: mrp_flattened_bom_xlsx_subcontracting_cost
#: model:ir.model,name:mrp_flattened_bom_xlsx_subcontracting_cost.model_mrp_bom
msgid "Bill of Material"
msgstr "Distinta base"

#. module: mrp_flattened_bom_xlsx_subcontracting_cost
#. odoo-python
#: code:addons/mrp_flattened_bom_xlsx_subcontracting_cost/report/flattened_bom_xlsx.py:0
#, python-format
msgid "Currency"
msgstr "Valuta"

#. module: mrp_flattened_bom_xlsx_subcontracting_cost
#: model:ir.model,name:mrp_flattened_bom_xlsx_subcontracting_cost.model_report_mrp_flattened_bom_xlsx_flattened_bom_xlsx
msgid "Flattened BOM XLSX"
msgstr "XLSX distinta base tecnica"

#. module: mrp_flattened_bom_xlsx_subcontracting_cost
#. odoo-python
#: code:addons/mrp_flattened_bom_xlsx_subcontracting_cost/report/flattened_bom_xlsx.py:0
#, python-format
msgid "Internal Reference"
msgstr "Riferimento interno"

#. module: mrp_flattened_bom_xlsx_subcontracting_cost
#. odoo-python
#: code:addons/mrp_flattened_bom_xlsx_subcontracting_cost/report/flattened_bom_xlsx.py:0
#, python-format
msgid "Level"
msgstr "Livello"

#. module: mrp_flattened_bom_xlsx_subcontracting_cost
#. odoo-python
#: code:addons/mrp_flattened_bom_xlsx_subcontracting_cost/report/flattened_bom_xlsx.py:0
#, python-format
msgid "Main BOM"
msgstr "DiBa principale"

#. module: mrp_flattened_bom_xlsx_subcontracting_cost
#. odoo-python
#: code:addons/mrp_flattened_bom_xlsx_subcontracting_cost/report/flattened_bom_xlsx.py:0
#, python-format
msgid "Partner Name"
msgstr "Nome partner"

#. module: mrp_flattened_bom_xlsx_subcontracting_cost
#. odoo-python
#: code:addons/mrp_flattened_bom_xlsx_subcontracting_cost/report/flattened_bom_xlsx.py:0
#, python-format
msgid "Product Name"
msgstr "Nome prodotto"

#. module: mrp_flattened_bom_xlsx_subcontracting_cost
#. odoo-python
#: code:addons/mrp_flattened_bom_xlsx_subcontracting_cost/report/flattened_bom_xlsx.py:0
#, python-format
msgid "Quantity"
msgstr "Quantità"

#. module: mrp_flattened_bom_xlsx_subcontracting_cost
#. odoo-python
#: code:addons/mrp_flattened_bom_xlsx_subcontracting_cost/report/flattened_bom_xlsx.py:0
#, python-format
msgid "Subcontracted BOM"
msgstr "DiBa subappaltato"

#. module: mrp_flattened_bom_xlsx_subcontracting_cost
#. odoo-python
#: code:addons/mrp_flattened_bom_xlsx_subcontracting_cost/report/flattened_bom_xlsx.py:0
#: model:ir.model.fields,field_description:mrp_flattened_bom_xlsx_subcontracting_cost.field_mrp_bom__subcontracting_cost
#, python-format
msgid "Subcontracting Cost"
msgstr "Costo subappalto"

#. module: mrp_flattened_bom_xlsx_subcontracting_cost
#. odoo-python
#: code:addons/mrp_flattened_bom_xlsx_subcontracting_cost/report/flattened_bom_xlsx.py:0
#, python-format
msgid "Subcontracting Costs"
msgstr "Costi subappalto"

#. module: mrp_flattened_bom_xlsx_subcontracting_cost
#. odoo-python
#: code:addons/mrp_flattened_bom_xlsx_subcontracting_cost/report/flattened_bom_xlsx.py:0
#, python-format
msgid "Subcontracting Unit Cost"
msgstr "Costo unitario subappalto"

#. module: mrp_flattened_bom_xlsx_subcontracting_cost
#. odoo-python
#: code:addons/mrp_flattened_bom_xlsx_subcontracting_cost/report/flattened_bom_xlsx.py:0
#, python-format
msgid "Unit of Measure"
msgstr "Unità di misura"

#~ msgid "Display Name"
#~ msgstr "Nome visualizzato"

#~ msgid "ID"
#~ msgstr "ID"

#~ msgid "Last Modified on"
#~ msgstr "Ultima modifica il"
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mrp_flattened_bom_xlsx_subcontracting_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_subcontracting_cost
#: model:ir.model,name:mrp_flattened_bom_xlsx_subcontracting_cost.model_mrp_bom
msgid "Bill of Material"
msgstr ""

#. module: mrp_flattened_bom_xlsx_subcontracting_cost
#. odoo-python
#: code:addons/mrp_flattened_bom_xlsx_subcontracting_cost/report/flattened_bom_xlsx.py:0
#, python-format
msgid "Currency"
msgstr ""

#. module: mrp_flattened_bom_xlsx_subcontracting_cost
#: model:ir.model,name:mrp_flattened_bom_xlsx_subcontracting_cost.model_report_mrp_flattened_bom_xlsx_flattened_bom_xlsx
msgid "Flattened BOM XLSX"
msgstr ""

#. module: mrp_flattened_bom_xlsx_subcontracting_cost
#. odoo-python
#: code:addons/mrp_flattened_bom_xlsx_subcontracting_cost/report/flattened_bom_xlsx.py:0
#, python-format
msgid "Internal Reference"
msgstr ""

#. module: mrp_flattened_bom_xlsx_subcontracting_cost
#. odoo-python
#: code:addons/mrp_flattened_bom_xlsx_subcontracting_cost/report/flattened_bom_xlsx.py:0
#, python-format
msgid "Level"
msgstr ""

#. module: mrp_flattened_bom_xlsx_subcontracting_cost
#. odoo-python
#: code:addons/mrp_flattened_bom_xlsx_subcontracting_cost/report/flattened_bom_xlsx.py:0
#, python-format
msgid "Main BOM"
msgstr ""

#. module: mrp_flattened_bom_xlsx_subcontracting_cost
#. odoo-python
#: code:addons/mrp_flattened_bom_xlsx_subcontracting_cost/report/flattened_bom_xlsx.py:0
#, python-format
msgid "Partner Name"
msgstr ""

#. module: mrp_flattened_bom_xlsx_subcontracting_cost
#. odoo-python
#: code:addons/mrp_flattened_bom_xlsx_subcontracting_cost/report/flattened_bom_xlsx.py:0
#, python-format
msgid "Product Name"
msgstr ""

#. module: mrp_flattened_bom_xlsx_subcontracting_cost
#. odoo-python
#: code:addons/mrp_flattened_bom_xlsx_subcontracting_cost/report/flattened_bom_xlsx.py:0
#, python-format
msgid "Quantity"
msgstr ""

#. module: mrp_flattened_bom_xlsx_subcontracting_cost
#. odoo-python
#: code:addons/mrp_flattened_bom_xlsx_subcontracting_cost/report/flattened_bom_xlsx.py:0
#, python-format
msgid "Subcontracted BOM"
msgstr ""

#. module: mrp_flattened_bom_xlsx_subcontracting_cost
#. odoo-python
#: code:addons/mrp_flattened_bom_xlsx_subcontracting_cost/report/flattened_bom_xlsx.py:0
#: model:ir.model.fields,field_description:mrp_flattened_bom_xlsx_subcontracting_cost.field_mrp_bom__subcontracting_cost
#, python-format
msgid "Subcontracting Cost"
msgstr ""

#. module: mrp_flattened_bom_xlsx_subcontracting_cost
#. odoo-python
#: code:addons/mrp_flattened_bom_xlsx_subcontracting_cost/report/flattened_bom_xlsx.py:0
#, python-format
msgid "Subcontracting Costs"
msgstr ""

#. module: mrp_flattened_bom_xlsx_subcontracting_cost
#. odoo-python
#: code:addons/mrp_flattened_bom_xlsx_subcontracting_cost/report/flattened_bom_xlsx.py:0
#, python-format
msgid "Subcontracting Unit Cost"
msgstr ""

#. module: mrp_flattened_bom_xlsx_subcontracting_cost
#. odoo-python
#: code:addons/mrp_flattened_bom_xlsx_subcontracting_cost/report/flattened_bom_xlsx.py:0
#, python-format
msgid "Unit of Measure"
msgstr ""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import mrp_bom
28 changes: 28 additions & 0 deletions mrp_flattened_bom_xlsx_subcontracting_cost/models/mrp_bom.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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"

subcontracting_cost = fields.Float(
compute="_compute_subcontracting_cost",
digits="Product Price",
)

def _compute_subcontracting_cost(self):
supplier_info_obj = self.env["product.supplierinfo"]
for bom in self:
if bom.type == "subcontract" and bom.subcontractor_ids:
supplier_info = supplier_info_obj.search(
[
("partner_id", "=", bom.subcontractor_ids[0].id),
("product_tmpl_id", "=", bom.product_tmpl_id.id),
],
limit=1,
)
bom.subcontracting_cost = supplier_info.price
else:
bom.subcontracting_cost = 0.0
3 changes: 3 additions & 0 deletions mrp_flattened_bom_xlsx_subcontracting_cost/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Bernat Puig Font \<[email protected]\>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module extends the report of the Export Flattened BOM to Excel
module with a new tab showing the subcontracting cost.
9 changes: 9 additions & 0 deletions mrp_flattened_bom_xlsx_subcontracting_cost/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -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'.
2 changes: 2 additions & 0 deletions mrp_flattened_bom_xlsx_subcontracting_cost/report/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from . import flattened_bom_xlsx
Loading
Loading