diff --git a/mrp_lot_on_hand_first/README.rst b/mrp_lot_on_hand_first/README.rst new file mode 100644 index 000000000..ccfc3f41a --- /dev/null +++ b/mrp_lot_on_hand_first/README.rst @@ -0,0 +1 @@ +To be auto generated diff --git a/mrp_lot_on_hand_first/__init__.py b/mrp_lot_on_hand_first/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/mrp_lot_on_hand_first/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/mrp_lot_on_hand_first/__manifest__.py b/mrp_lot_on_hand_first/__manifest__.py new file mode 100644 index 000000000..1bb6222cc --- /dev/null +++ b/mrp_lot_on_hand_first/__manifest__.py @@ -0,0 +1,23 @@ +# Copyright 2022 Camptocamp SA +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) +{ + "name": "Mrp Lot On Hand First", + "summary": "Allows to display lots on hand first in M2o fields", + "version": "14.0.1.0.0", + "development_status": "Alpha", + "category": "Manufacturing/Manufacturing", + "website": "https://github.com/OCA/manufacture", + "author": "Camptocamp, Odoo Community Association (OCA)", + "maintainers": ["grindtildeath"], + "license": "AGPL-3", + "installable": True, + "auto_install": True, + "depends": [ + "mrp", + "stock_lot_on_hand_first", + ], + "data": [ + "views/mrp_production.xml", + "views/stock_picking_type.xml", + ], +} diff --git a/mrp_lot_on_hand_first/models/__init__.py b/mrp_lot_on_hand_first/models/__init__.py new file mode 100644 index 000000000..a9e5f13e4 --- /dev/null +++ b/mrp_lot_on_hand_first/models/__init__.py @@ -0,0 +1 @@ +from . import mrp_production diff --git a/mrp_lot_on_hand_first/models/mrp_production.py b/mrp_lot_on_hand_first/models/mrp_production.py new file mode 100644 index 000000000..c01145746 --- /dev/null +++ b/mrp_lot_on_hand_first/models/mrp_production.py @@ -0,0 +1,11 @@ +# Copyright 2022 Camptocamp SA +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl) +from odoo import fields, models + + +class MrpProduction(models.Model): + _inherit = "mrp.production" + + display_lots_on_hand_first = fields.Boolean( + related="picking_type_id.display_lots_on_hand_first" + ) diff --git a/mrp_lot_on_hand_first/readme/CONTRIBUTORS.rst b/mrp_lot_on_hand_first/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..f63494557 --- /dev/null +++ b/mrp_lot_on_hand_first/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* Akim Juillerat +* Ricardo Almeida Soares diff --git a/mrp_lot_on_hand_first/readme/DESCRIPTION.rst b/mrp_lot_on_hand_first/readme/DESCRIPTION.rst new file mode 100644 index 000000000..ba8805532 --- /dev/null +++ b/mrp_lot_on_hand_first/readme/DESCRIPTION.rst @@ -0,0 +1,3 @@ +This module allows to display lots with a quantity on hand as first results +in the lots selection fields for of Mrp Productions in order to avoid displaying old +lots that are not in stock anymore. diff --git a/mrp_lot_on_hand_first/views/mrp_production.xml b/mrp_lot_on_hand_first/views/mrp_production.xml new file mode 100644 index 000000000..6f97daa64 --- /dev/null +++ b/mrp_lot_on_hand_first/views/mrp_production.xml @@ -0,0 +1,22 @@ + + + + mrp.production.form.inherit + mrp.production + + + + + + + { + 'name_search_qty_on_hand_first': parent.display_lots_on_hand_first, + 'default_company_id': company_id, + 'default_product_id': product_id,} + + + + diff --git a/mrp_lot_on_hand_first/views/stock_picking_type.xml b/mrp_lot_on_hand_first/views/stock_picking_type.xml new file mode 100644 index 000000000..1ce963e2f --- /dev/null +++ b/mrp_lot_on_hand_first/views/stock_picking_type.xml @@ -0,0 +1,13 @@ + + + + Operation Types + stock.picking.type + + + + + + + + diff --git a/setup/mrp_lot_on_hand_first/odoo/addons/mrp_lot_on_hand_first b/setup/mrp_lot_on_hand_first/odoo/addons/mrp_lot_on_hand_first new file mode 120000 index 000000000..2e03da280 --- /dev/null +++ b/setup/mrp_lot_on_hand_first/odoo/addons/mrp_lot_on_hand_first @@ -0,0 +1 @@ +../../../../mrp_lot_on_hand_first \ No newline at end of file diff --git a/setup/mrp_lot_on_hand_first/setup.py b/setup/mrp_lot_on_hand_first/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/mrp_lot_on_hand_first/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)