From 91a557dcf4d6fbf7d0c6cb305c255164d56674d4 Mon Sep 17 00:00:00 2001 From: Simone Rubino Date: Sat, 1 Jan 2022 13:59:40 +0100 Subject: [PATCH] [ADD] mrp_production_filter_lot Co-authored-by: Simone Rubino --- mrp_production_filter_lot/README.rst | 80 ++++ mrp_production_filter_lot/__init__.py | 3 + mrp_production_filter_lot/__manifest__.py | 22 + mrp_production_filter_lot/i18n/it.po | 31 ++ .../readme/CONTRIBUTORS.rst | 1 + .../readme/DESCRIPTION.rst | 2 + mrp_production_filter_lot/readme/USAGE.rst | 5 + .../static/description/index.html | 430 ++++++++++++++++++ mrp_production_filter_lot/wizards/__init__.py | 3 + .../wizards/mrp_product_produce_line.py | 14 + .../wizards/mrp_product_produce_views.xml | 21 + 11 files changed, 612 insertions(+) create mode 100644 mrp_production_filter_lot/README.rst create mode 100644 mrp_production_filter_lot/__init__.py create mode 100644 mrp_production_filter_lot/__manifest__.py create mode 100644 mrp_production_filter_lot/i18n/it.po create mode 100644 mrp_production_filter_lot/readme/CONTRIBUTORS.rst create mode 100644 mrp_production_filter_lot/readme/DESCRIPTION.rst create mode 100644 mrp_production_filter_lot/readme/USAGE.rst create mode 100644 mrp_production_filter_lot/static/description/index.html create mode 100644 mrp_production_filter_lot/wizards/__init__.py create mode 100644 mrp_production_filter_lot/wizards/mrp_product_produce_line.py create mode 100644 mrp_production_filter_lot/wizards/mrp_product_produce_views.xml diff --git a/mrp_production_filter_lot/README.rst b/mrp_production_filter_lot/README.rst new file mode 100644 index 000000000..427f89d62 --- /dev/null +++ b/mrp_production_filter_lot/README.rst @@ -0,0 +1,80 @@ +========================= +MRP production filter lot +========================= + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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/github-OCA%2Fmanufacture-lightgray.png?logo=github + :target: https://github.com/OCA/manufacture/tree/12.0/mrp_production_filter_lot + :alt: OCA/manufacture +.. |badge3| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/manufacture-12-0/manufacture-12-0-mrp_production_filter_lot + :alt: Translate me on Weblate +.. |badge4| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/129/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| + +This module extends the functionality of mrp: during a production the user +can only select the lots of raw materials available in the production order's "Raw Materials Location". + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To use this module: + +#. Produce a production order containing raw materials that are tracked by lots. +#. In the production popup you will notice that the lots available + to select are the lots in the source location of the raw materials that have any availability. + +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 smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Takobi + +Contributors +~~~~~~~~~~~~ + +* Simone Rubino (https://takobi.online) + +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 `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/mrp_production_filter_lot/__init__.py b/mrp_production_filter_lot/__init__.py new file mode 100644 index 000000000..a370c4dcb --- /dev/null +++ b/mrp_production_filter_lot/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import wizards diff --git a/mrp_production_filter_lot/__manifest__.py b/mrp_production_filter_lot/__manifest__.py new file mode 100644 index 000000000..73ad9b7e8 --- /dev/null +++ b/mrp_production_filter_lot/__manifest__.py @@ -0,0 +1,22 @@ +# Copyright 2022 Simone Rubino - Takobi +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +{ + 'name': "MRP production filter lot", + 'summary': "In production order production popup, " + "filter lots based on their location and availability", + 'version': '12.0.1.0.0', + 'category': 'Manufacturing', + 'website': "https://github.com/OCA/manufacture/tree/" + "12.0/mrp_production_filter_lot", + 'author': "Takobi, " + "Odoo Community Association (OCA)", + 'license': 'AGPL-3', + 'depends': [ + 'mrp', + 'stock_picking_filter_lot', + ], + 'auto_install': True, + 'data': [ + 'wizards/mrp_product_produce_views.xml', + ], +} diff --git a/mrp_production_filter_lot/i18n/it.po b/mrp_production_filter_lot/i18n/it.po new file mode 100644 index 000000000..4eafc3864 --- /dev/null +++ b/mrp_production_filter_lot/i18n/it.po @@ -0,0 +1,31 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_production_filter_lot +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-01-01 15:55+0000\n" +"PO-Revision-Date: 2022-01-01 15:55+0000\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_production_filter_lot +#: model:ir.model.fields,help:mrp_production_filter_lot.field_mrp_product_produce_line__production_src_location_id +msgid "Location where the system will look for components." +msgstr "Punto di stoccaggio dove il sistema cercherà i componenti" + +#. module: mrp_production_filter_lot +#: model:ir.model.fields,field_description:mrp_production_filter_lot.field_mrp_product_produce_line__production_src_location_id +msgid "Production source location" +msgstr "Ubicazione di origine dell'ordine di produzione" + +#. module: mrp_production_filter_lot +#: model:ir.model,name:mrp_production_filter_lot.model_mrp_product_produce_line +msgid "Record Production Line" +msgstr "Record delle linee di produzione" diff --git a/mrp_production_filter_lot/readme/CONTRIBUTORS.rst b/mrp_production_filter_lot/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..f3e048a32 --- /dev/null +++ b/mrp_production_filter_lot/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Simone Rubino (https://takobi.online) diff --git a/mrp_production_filter_lot/readme/DESCRIPTION.rst b/mrp_production_filter_lot/readme/DESCRIPTION.rst new file mode 100644 index 000000000..545720b07 --- /dev/null +++ b/mrp_production_filter_lot/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +This module extends the functionality of mrp: during a production the user +can only select the lots of raw materials available in the production order's "Raw Materials Location". diff --git a/mrp_production_filter_lot/readme/USAGE.rst b/mrp_production_filter_lot/readme/USAGE.rst new file mode 100644 index 000000000..cd181e185 --- /dev/null +++ b/mrp_production_filter_lot/readme/USAGE.rst @@ -0,0 +1,5 @@ +To use this module: + +#. Produce a production order containing raw materials that are tracked by lots. +#. In the production popup you will notice that the lots available + to select are the lots in the source location of the raw materials that have any availability. diff --git a/mrp_production_filter_lot/static/description/index.html b/mrp_production_filter_lot/static/description/index.html new file mode 100644 index 000000000..b0658d990 --- /dev/null +++ b/mrp_production_filter_lot/static/description/index.html @@ -0,0 +1,430 @@ + + + + + + +MRP production filter lot + + + +
+

MRP production filter lot

+ + +

Beta OCA/manufacture Translate me on Weblate Try me on Runbot

+

This module extends the functionality of mrp: during a production the user +can only select the lots of raw materials available in the production order’s “Raw Materials Location”.

+

Table of contents

+ +
+

Usage

+

To use this module:

+
    +
  1. Produce a production order containing raw materials that are tracked by lots.
  2. +
  3. In the production popup you will notice that the lots available +to select are the lots in the source location of the raw materials that have any availability.
  4. +
+
+
+

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 smashing it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Takobi
  • +
+
+ +
+

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 project on GitHub.

+

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

+
+
+
+ + diff --git a/mrp_production_filter_lot/wizards/__init__.py b/mrp_production_filter_lot/wizards/__init__.py new file mode 100644 index 000000000..7784175f3 --- /dev/null +++ b/mrp_production_filter_lot/wizards/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import mrp_product_produce_line diff --git a/mrp_production_filter_lot/wizards/mrp_product_produce_line.py b/mrp_production_filter_lot/wizards/mrp_product_produce_line.py new file mode 100644 index 000000000..4378b495c --- /dev/null +++ b/mrp_production_filter_lot/wizards/mrp_product_produce_line.py @@ -0,0 +1,14 @@ +# Copyright 2022 Simone Rubino - Takobi +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class MrpProductProduceLine (models.TransientModel): + _inherit = "mrp.product.produce.line" + + production_src_location_id = fields.Many2one( + string="Production source location", + related='product_produce_id.production_id.location_src_id', + readonly=True, + ) diff --git a/mrp_production_filter_lot/wizards/mrp_product_produce_views.xml b/mrp_production_filter_lot/wizards/mrp_product_produce_views.xml new file mode 100644 index 000000000..873a81d59 --- /dev/null +++ b/mrp_production_filter_lot/wizards/mrp_product_produce_views.xml @@ -0,0 +1,21 @@ + + + + + + Filter lot in production wizard + mrp.product.produce + + + + + + + [('product_id','=', product_id),('location_ids', 'child_of', production_src_location_id)] + + + +