-
-
Notifications
You must be signed in to change notification settings - Fork 490
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by LoisRForgeFlow
- Loading branch information
Showing
19 changed files
with
848 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
================ | ||
MRP BOM Location | ||
================ | ||
|
||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |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-LGPL--3-blue.png | ||
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html | ||
:alt: License: LGPL-3 | ||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github | ||
:target: https://github.com/OCA/manufacture/tree/15.0/mrp_bom_location | ||
:alt: OCA/manufacture | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/manufacture-15-0/manufacture-15-0-mrp_bom_location | ||
:alt: Translate me on Weblate | ||
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png | ||
:target: https://runbot.odoo-community.org/runbot/129/15.0 | ||
:alt: Try me on Runbot | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
This module adds the location field to the Bill of Materials and its components. This may be useful to distinguish between different BoMs for the same product or to highlight the preferred locations to fetch the components from. | ||
|
||
The location appears in the BOM Structure Report. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Usage | ||
===== | ||
|
||
To use this module, you need to: | ||
|
||
#. Go to *Manufacturing > Bill of Materials*. | ||
#. Pick or create one of them. | ||
#. You will see a new field to fill called "Location". | ||
#. On the structure report *BOM > Print > BOM Structure* location field is present | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/manufacture/issues>`_. | ||
In case of trouble, please check there if your issue has already been reported. | ||
If you spotted it first, help us smashing it by providing a detailed and welcomed | ||
`feedback <https://github.com/OCA/manufacture/issues/new?body=module:%20mrp_bom_location%0Aversion:%2015.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 | ||
~~~~~~~~~~~~ | ||
|
||
* Lois Rilo <lois.rilo@forgeflow.com> | ||
* Mykhailo Panarin <m.panarin@mobilunity.com> | ||
* Saran Limpajitkutaporn <saranl@ecosoft.co.th> | ||
* Sudhir Arya <sudhir@erpharbor.com> | ||
|
||
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 <https://github.com/OCA/manufacture/tree/15.0/mrp_bom_location>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from . import models | ||
from . import report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Copyright 2017-20 ForgeFlow S.L. (https://www.forgeflow.com) | ||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). | ||
{ | ||
"name": "MRP BOM Location", | ||
"summary": "Adds location field to Bill of Materials and its components.", | ||
"version": "16.0.1.0.0", | ||
"category": "Manufacture", | ||
"website": "https://github.com/OCA/manufacture", | ||
"author": "ForgeFlow, Odoo Community Association (OCA)", | ||
"license": "LGPL-3", | ||
"application": False, | ||
"depends": ["mrp"], | ||
"data": ["views/mrp_view.xml", "views/report_mrpbomstructure.xml"], | ||
"installable": True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * mrp_bom_location | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 11.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: 2018-12-09 10:43+0000\n" | ||
"Last-Translator: Maria Sparenberg <maria.sparenberg@gmx.net>\n" | ||
"Language-Team: none\n" | ||
"Language: de\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 3.3\n" | ||
|
||
#. module: mrp_bom_location | ||
#: model:ir.model,name:mrp_bom_location.model_report_mrp_report_bom_structure | ||
msgid "BOM Structure Report" | ||
msgstr "" | ||
|
||
#. module: mrp_bom_location | ||
#: model:ir.model,name:mrp_bom_location.model_mrp_bom | ||
msgid "Bill of Material" | ||
msgstr "Stückliste" | ||
|
||
#. module: mrp_bom_location | ||
#: model:ir.model,name:mrp_bom_location.model_mrp_bom_line | ||
#, fuzzy | ||
msgid "Bill of Material Line" | ||
msgstr "Stückliste" | ||
|
||
#. module: mrp_bom_location | ||
#: model:ir.model.fields,field_description:mrp_bom_location.field_mrp_bom__location_id | ||
#: model:ir.model.fields,field_description:mrp_bom_location.field_mrp_bom_line__location_id | ||
#: model_terms:ir.ui.view,arch_db:mrp_bom_location.report_mrpbomstructure_location | ||
#: model_terms:ir.ui.view,arch_db:mrp_bom_location.view_mrp_bom_filter | ||
msgid "Location" | ||
msgstr "Lagerort" | ||
|
||
#. module: mrp_bom_location | ||
#: model_terms:ir.ui.view,arch_db:mrp_bom_location.report_mrpbomstructure_location | ||
msgid "Location of the product" | ||
msgstr "" | ||
|
||
#~ msgid "mrp.bom.line" | ||
#~ msgstr "mrp.bom.line" | ||
|
||
#~ msgid "report.mrp.mrp_bom_structure_report" | ||
#~ msgstr "report.mrp.mrp_bom_structure_report" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * mrp_bom_location | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 15.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: 2023-01-01 13:45+0000\n" | ||
"Last-Translator: mymage <stefano.consolaro@mymage.it>\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_bom_location | ||
#: model:ir.model,name:mrp_bom_location.model_report_mrp_report_bom_structure | ||
msgid "BOM Structure Report" | ||
msgstr "Resoconto struttura DiBa" | ||
|
||
#. module: mrp_bom_location | ||
#: model:ir.model,name:mrp_bom_location.model_mrp_bom | ||
msgid "Bill of Material" | ||
msgstr "Distinta base" | ||
|
||
#. module: mrp_bom_location | ||
#: model:ir.model,name:mrp_bom_location.model_mrp_bom_line | ||
msgid "Bill of Material Line" | ||
msgstr "Riga distinta base" | ||
|
||
#. module: mrp_bom_location | ||
#: model:ir.model.fields,field_description:mrp_bom_location.field_mrp_bom__location_id | ||
#: model:ir.model.fields,field_description:mrp_bom_location.field_mrp_bom_line__location_id | ||
#: model_terms:ir.ui.view,arch_db:mrp_bom_location.report_mrpbomstructure_location | ||
#: model_terms:ir.ui.view,arch_db:mrp_bom_location.view_mrp_bom_filter | ||
msgid "Location" | ||
msgstr "Ubicazione" | ||
|
||
#. module: mrp_bom_location | ||
#: model_terms:ir.ui.view,arch_db:mrp_bom_location.report_mrpbomstructure_location | ||
msgid "Location of the product" | ||
msgstr "Ubicazione del prodotto" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * mrp_bom_location | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 15.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_bom_location | ||
#: model:ir.model,name:mrp_bom_location.model_report_mrp_report_bom_structure | ||
msgid "BOM Structure Report" | ||
msgstr "" | ||
|
||
#. module: mrp_bom_location | ||
#: model:ir.model,name:mrp_bom_location.model_mrp_bom | ||
msgid "Bill of Material" | ||
msgstr "" | ||
|
||
#. module: mrp_bom_location | ||
#: model:ir.model,name:mrp_bom_location.model_mrp_bom_line | ||
msgid "Bill of Material Line" | ||
msgstr "" | ||
|
||
#. module: mrp_bom_location | ||
#: model:ir.model.fields,field_description:mrp_bom_location.field_mrp_bom__location_id | ||
#: model:ir.model.fields,field_description:mrp_bom_location.field_mrp_bom_line__location_id | ||
#: model_terms:ir.ui.view,arch_db:mrp_bom_location.report_mrpbomstructure_location | ||
#: model_terms:ir.ui.view,arch_db:mrp_bom_location.view_mrp_bom_filter | ||
msgid "Location" | ||
msgstr "" | ||
|
||
#. module: mrp_bom_location | ||
#: model_terms:ir.ui.view,arch_db:mrp_bom_location.report_mrpbomstructure_location | ||
msgid "Location of the product" | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import mrp_bom |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright 2017-20 ForgeFlow S.L. (https://www.forgeflow.com) | ||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). | ||
|
||
from odoo import api, fields, models | ||
|
||
|
||
class MrpBom(models.Model): | ||
_inherit = "mrp.bom" | ||
|
||
location_id = fields.Many2one(string="Location", comodel_name="stock.location") | ||
|
||
@api.onchange("picking_type_id") | ||
def _onchange_picking_type_id(self): | ||
if self.picking_type_id and self.picking_type_id.default_location_src_id: | ||
self.location_id = self.picking_type_id.default_location_src_id | ||
|
||
|
||
class MrpBomLine(models.Model): | ||
_inherit = "mrp.bom.line" | ||
|
||
location_id = fields.Many2one(related="bom_id.location_id", store=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
* Lois Rilo <lois.rilo@forgeflow.com> | ||
* Mykhailo Panarin <m.panarin@mobilunity.com> | ||
* Saran Limpajitkutaporn <saranl@ecosoft.co.th> | ||
* Sudhir Arya <sudhir@erpharbor.com> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
This module adds the location field to the Bill of Materials and its components. This may be useful to distinguish between different BoMs for the same product or to highlight the preferred locations to fetch the components from. | ||
|
||
The location appears in the BOM Structure Report. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
To use this module, you need to: | ||
|
||
#. Go to *Manufacturing > Bill of Materials*. | ||
#. Pick or create one of them. | ||
#. You will see a new field to fill called "Location". | ||
#. On the structure report *BOM > Print > BOM Structure* location field is present |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import bom_structure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Copyright 2017-20 ForgeFlow S.L. (https://www.forgeflow.com) | ||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). | ||
|
||
from odoo import api, models | ||
|
||
|
||
class BomStructureReport(models.AbstractModel): | ||
_inherit = "report.mrp.report_bom_structure" | ||
|
||
@api.model | ||
def _get_bom_lines(self, bom, bom_quantity, product, line_id, level): | ||
res = super(BomStructureReport, self)._get_bom_lines( | ||
bom, bom_quantity, product, line_id, level | ||
) | ||
line_ids = self.env["mrp.bom.line"].search([("bom_id", "=", bom.id)]) | ||
for line in res[0]: | ||
line_id = line_ids.filtered( | ||
lambda l: l.location_id and l.id == line["line_id"] | ||
) | ||
line["location_id"] = line_id.location_id or "" | ||
return res | ||
|
||
@api.model | ||
def _get_pdf_line( | ||
self, bom_id, product_id=False, qty=1, child_bom_ids=None, unfolded=False | ||
): | ||
res = super(BomStructureReport, self)._get_pdf_line( | ||
bom_id, product_id, qty, child_bom_ids, unfolded | ||
) | ||
line_ids = self.env["mrp.bom.line"].search([("bom_id", "=", bom_id)]) | ||
for line in res["lines"]: | ||
line_id = line_ids.filtered( | ||
lambda l: l.location_id and l.product_id.display_name == line["name"] | ||
) | ||
line["location_name"] = line_id.location_id.complete_name or "" | ||
return res |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.