diff --git a/stock_putaway_method/README.rst b/stock_putaway_method/README.rst new file mode 100644 index 000000000..5a5fb32c7 --- /dev/null +++ b/stock_putaway_method/README.rst @@ -0,0 +1,50 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png + :target: https://www.gnu.org/licenses/agpl + :alt: License: AGPL-3 + +======================= +Putaway strategy method +======================= + +This module adds the putaway strategy method back, removed from the stock module in Odoo 11. + +Installation +============ + +To install this module, just click the install button. This module is automatically installed when installing relying modules such as *stock_putaway_product*. + +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 +------------ + +* Alexandre Saunier - Camptocamp SA + +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/stock_putaway_method/__init__.py b/stock_putaway_method/__init__.py new file mode 100644 index 000000000..1ca945db8 --- /dev/null +++ b/stock_putaway_method/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from . import models +from . import tests diff --git a/stock_putaway_method/__manifest__.py b/stock_putaway_method/__manifest__.py new file mode 100644 index 000000000..1bd1497f6 --- /dev/null +++ b/stock_putaway_method/__manifest__.py @@ -0,0 +1,20 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +{ + 'name': 'Putaway strategy method', + 'summary': 'Add the putaway strategy method back, ' + 'removed from the stock module in Odoo 11', + 'version': '11.0.1.0.0', + 'category': 'Inventory', + 'website': 'https://www.camptocamp.com', + 'author': 'Camptocamp SA, ' + 'Odoo Community Association (OCA)', + 'license': 'AGPL-3', + 'depends': [ + 'product', + 'stock' + ], + 'data': [ + 'views/product_strategy_views.xml' + ], + 'demo': [] +} diff --git a/stock_putaway_method/models/__init__.py b/stock_putaway_method/models/__init__.py new file mode 100644 index 000000000..39f0f528b --- /dev/null +++ b/stock_putaway_method/models/__init__.py @@ -0,0 +1,2 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from . import product_strategy diff --git a/stock_putaway_method/models/product_strategy.py b/stock_putaway_method/models/product_strategy.py new file mode 100644 index 000000000..ba2604278 --- /dev/null +++ b/stock_putaway_method/models/product_strategy.py @@ -0,0 +1,18 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class PutAwayStrategy(models.Model): + _inherit = 'product.putaway' + + method = fields.Selection( + selection='_get_putaway_options', + string='Method', + default='fixed', + required=True, + ) + + @api.model + def _get_putaway_options(self): + return [('fixed', 'Fixed Location')] diff --git a/stock_putaway_method/tests/__init__.py b/stock_putaway_method/tests/__init__.py new file mode 100644 index 000000000..9b98682b0 --- /dev/null +++ b/stock_putaway_method/tests/__init__.py @@ -0,0 +1,2 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from . import test_putaway_method diff --git a/stock_putaway_method/tests/test_putaway_method.py b/stock_putaway_method/tests/test_putaway_method.py new file mode 100644 index 000000000..75f85762b --- /dev/null +++ b/stock_putaway_method/tests/test_putaway_method.py @@ -0,0 +1,12 @@ +# Copyright 2018 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.tests.common import TransactionCase + + +class TestPutawayMethod(TransactionCase): + + # Check if "fixed" is a valid putaway method + def test_01_putaway_methods(self): + field_method = self.env['product.putaway']._fields.get('method') + self.assertIn('fixed', field_method.get_values(self.env)) diff --git a/stock_putaway_method/views/product_strategy_views.xml b/stock_putaway_method/views/product_strategy_views.xml new file mode 100644 index 000000000..31c960c99 --- /dev/null +++ b/stock_putaway_method/views/product_strategy_views.xml @@ -0,0 +1,29 @@ + + + + + product.putaway.form.method + product.putaway + + + +
+ + + + +
+ + + + + + + + +
+
+
+
+
+