Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
cf2877b
[9.0][ADD] mrp_bom_location
LoisRForgeFlow Sep 15, 2017
3c4b136
add location to bom structure report
JordiBForgeFlow Sep 29, 2017
4d61483
[IMP] mrp_bom_location: fix lint, renamed object to record
Feb 12, 2018
30ea0e4
[MIG] mrp_bom_location: Migration to Odoo 11
Feb 12, 2018
7c2846b
[IMP] Make the related location readonly
jgrandguillaume Mar 14, 2018
a8caae3
[IMP] make an onchange for location_id, fix readme
Mar 16, 2018
8914b23
[11.0][IMP] mrp_bom_location: take advantage of the new hook method i…
LoisRForgeFlow Jun 26, 2018
f12719b
[UPD] Update mrp_bom_location.pot
oca-travis Jul 3, 2018
c20d80c
Added translation using Weblate (German)
marylla Dec 9, 2018
1ac6caf
Translated using Weblate (German)
marylla Dec 9, 2018
b49a8c7
[MIG] mrp_bom_location: Migration to 12.0
Saran440 Apr 18, 2019
d1d91c5
[UPD] README.rst
OCA-git-bot Apr 29, 2019
49383c9
[UPD] Update mrp_bom_location.pot
oca-travis Apr 29, 2019
74f312a
Update translation files
oca-transbot May 20, 2019
ecb324b
[UPD] README.rst
OCA-git-bot Jul 29, 2019
26808dd
[FIX] mrp_bom_location: location_name report display improvement
HviorForgeFlow Sep 27, 2019
06c486a
mrp_bom_location 12.0.1.0.1
OCA-git-bot Oct 1, 2019
af3c7ed
[MIG] Migrated the module mrp_bom_location to v13.
sudhir-erpharbor Oct 11, 2019
bc0a377
[UPD] Update mrp_bom_location.pot
oca-travis Dec 20, 2019
74472cd
[UPD] README.rst
OCA-git-bot Dec 20, 2019
df6f13b
[13.0] mrp_bom_location: copyrights update
LoisRForgeFlow Jan 15, 2020
e520c33
[UPD] README.rst
OCA-git-bot Jan 15, 2020
18f59f1
pre-commit update
OCA-git-bot Mar 14, 2020
bb396b7
Update translation files
oca-transbot Nov 22, 2020
c20efff
[IMP] mrp_bom_location : black, isort, prettier
DavidBForgeFlow Jan 25, 2021
7327cca
[MIG] mrp_bom_location: Migration to 14.0
DavidBForgeFlow Jan 27, 2021
53503ec
[UPD] Update mrp_bom_location.pot
oca-travis Feb 1, 2021
df66c16
[MIG] account_payment_mode: Migration to 15.0
dnplkndll Nov 18, 2021
545930b
[UPD] Update mrp_bom_location.pot
Nov 22, 2021
eabbfcc
Added translation using Weblate (Italian)
mymage Dec 19, 2022
62d3f63
[IMP] mrp_bom_location: pre-commit stuff
mymage Jan 4, 2023
97b2b21
[MIG] mrp_bom_location: Migration to 16.0
mymage Jan 4, 2023
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
88 changes: 88 additions & 0 deletions mrp_bom_location/README.rst
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.
2 changes: 2 additions & 0 deletions mrp_bom_location/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from . import report
15 changes: 15 additions & 0 deletions mrp_bom_location/__manifest__.py
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,
}
52 changes: 52 additions & 0 deletions mrp_bom_location/i18n/de.po
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"
45 changes: 45 additions & 0 deletions mrp_bom_location/i18n/it.po
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"
42 changes: 42 additions & 0 deletions mrp_bom_location/i18n/mrp_bom_location.pot
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 ""
1 change: 1 addition & 0 deletions mrp_bom_location/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import mrp_bom
21 changes: 21 additions & 0 deletions mrp_bom_location/models/mrp_bom.py
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)
4 changes: 4 additions & 0 deletions mrp_bom_location/readme/CONTRIBUTORS.rst
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>
3 changes: 3 additions & 0 deletions mrp_bom_location/readme/DESCRIPTION.rst
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.
6 changes: 6 additions & 0 deletions mrp_bom_location/readme/USAGE.rst
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
1 change: 1 addition & 0 deletions mrp_bom_location/report/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import bom_structure
36 changes: 36 additions & 0 deletions mrp_bom_location/report/bom_structure.py
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
Binary file added mrp_bom_location/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading