diff --git a/mrp_bom_location/README.rst b/mrp_bom_location/README.rst new file mode 100644 index 000000000..aac54f611 --- /dev/null +++ b/mrp_bom_location/README.rst @@ -0,0 +1,62 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl + :alt: License: AGPL-3 + +================ +MRP BOM Location +================ + +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. + +Usage +===== + +To use this module, you need to: + +#. Go to *Manufacturing > Bill of Materials*. + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/129/9.0 + +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 smash it by providing detailed and welcomed feedback. + +Credits +======= + +Images +------ + +* Odoo Community Association: `Icon `_. + +Contributors +------------ + +* Lois Rilo + +Do not contact contributors directly about support or help with technical +issues. + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +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. + +To contribute to this module, please visit https://odoo-community.org. diff --git a/mrp_bom_location/__init__.py b/mrp_bom_location/__init__.py new file mode 100644 index 000000000..7201c0805 --- /dev/null +++ b/mrp_bom_location/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Eficent Business and IT Consulting Services S.L. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import models diff --git a/mrp_bom_location/__openerp__.py b/mrp_bom_location/__openerp__.py new file mode 100644 index 000000000..14b76319b --- /dev/null +++ b/mrp_bom_location/__openerp__.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Eficent Business and IT Consulting Services S.L. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +{ + "name": "MRP BOM Location", + "summary": "Adds location field to Bill of Materials and its components.", + "version": "9.0.1.0.0", + "category": "Manufacture", + "website": "https://odoo-community.org/", + "author": "Eficent, Odoo Community Association (OCA)", + "license": "AGPL-3", + "application": False, + "installable": True, + "depends": [ + "mrp", + ], + "data": [ + "views/mrp_view.xml", + ], +} diff --git a/mrp_bom_location/models/__init__.py b/mrp_bom_location/models/__init__.py new file mode 100644 index 000000000..c381246d4 --- /dev/null +++ b/mrp_bom_location/models/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Eficent Business and IT Consulting Services S.L. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import mrp_bom diff --git a/mrp_bom_location/models/mrp_bom.py b/mrp_bom_location/models/mrp_bom.py new file mode 100644 index 000000000..50f317648 --- /dev/null +++ b/mrp_bom_location/models/mrp_bom.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Eficent Business and IT Consulting Services S.L. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from openerp import fields, models + + +class MrpBom(models.Model): + _inherit = "mrp.bom" + + location_id = fields.Many2one( + comodel_name="stock.location", string="Location", + help="Set the preferred location for this BOM.", + domain=[('usage', '=', 'internal')]) + + +class MrpBom(models.Model): + _inherit = "mrp.bom.line" + + location_id = fields.Many2one( + comodel_name="stock.location", string="Location", + help="Location which it is expected to get the products from.", + domain=[('usage', '=', 'internal')]) diff --git a/mrp_bom_location/static/description/icon.png b/mrp_bom_location/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/mrp_bom_location/static/description/icon.png differ diff --git a/mrp_bom_location/views/mrp_view.xml b/mrp_bom_location/views/mrp_view.xml new file mode 100644 index 000000000..49d1b8a3c --- /dev/null +++ b/mrp_bom_location/views/mrp_view.xml @@ -0,0 +1,81 @@ + + + + + + mrp.bom.form - mrp_bom_location + mrp.bom + + + + + + + + + + + mrp.bom.tree - mrp_bom_location + mrp.bom + + + + + + + + + + mrp.bom.select - mrp_bom_location + mrp.bom + + + + + + + + + + + + + mrp.bom.component.tree - mrp_bom_location + mrp.bom.line + + + + + + + + + + mrp.bom.tree - mrp_bom_location + mrp.bom.line + + + + + + + + + + mrp.bom.line.select - mrp_bom_location + mrp.bom.line + + + + + + + + + + + +