diff --git a/stock_request_tier_validation/README.rst b/stock_request_tier_validation/README.rst new file mode 100644 index 000000000..52385d84d --- /dev/null +++ b/stock_request_tier_validation/README.rst @@ -0,0 +1,118 @@ +============================= +Stock Request Tier Validation +============================= + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! 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-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github + :target: https://github.com/OCA/stock-logistics-warehouse/tree/11.0/stock_request_tier_validation + :alt: OCA/stock-logistics-warehouse +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-11-0/stock-logistics-warehouse-11-0-stock_request_tier_validation + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/153/11.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module extends the functionality of Stock Requests and Stock Request +Orders to support a tier validation process. + +**Table of contents** + +.. contents:: + :local: + +Installation +============ + +This module depends on ``base_tier_validation``. You can find it at +`OCA/server-ux `_ + +Configuration +============= + +A default tier is created allowing Stock Request Manager to approve Stock +Request and Stock Request Orders. + +In addition, you may want to add more tiers, so: + +#. Go to *Settings > Technical > Tier Validations > Tier Definition*. +#. Create as many tiers as you want for Purchase Order model. + +Usage +===== + +To use this module, you need to: + +#. Create a Stock Request triggering at least one "Tier Definition". +#. Click on *Request Validation* button. +#. Under the tab *Reviews* have a look to pending reviews and their statuses. +#. Once all reviews are validated button to *Confirm* will be shown. + +Additional features: + +* You can filter the Stock Request requesting your review through the filter *Needs my + Review*. +* User with rights to confirm the Stock Request (validate all tiers that would + be generated) can directly do the operation, this is, there is no need for + her/him to request a validation. + +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 +~~~~~~~ + +* Eficent + +Contributors +~~~~~~~~~~~~ + +* Lois Rilo +* Héctor Villarreal + +Other credits +~~~~~~~~~~~~~ + +Images +------ + +* Enric Tobella (logo) + +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/stock-logistics-warehouse `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/stock_request_tier_validation/__init__.py b/stock_request_tier_validation/__init__.py new file mode 100644 index 000000000..31660d6a9 --- /dev/null +++ b/stock_request_tier_validation/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import models diff --git a/stock_request_tier_validation/__manifest__.py b/stock_request_tier_validation/__manifest__.py new file mode 100644 index 000000000..87fcb9939 --- /dev/null +++ b/stock_request_tier_validation/__manifest__.py @@ -0,0 +1,23 @@ +# Copyright 2019 Eficent Business and IT Consulting Services S.L. +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +{ + "name": "Stock Request Tier Validation", + "summary": "Extends the functionality of Stock Requests to " + "support a tier validation process.", + "version": "11.0.1.0.0", + "category": "Warehouse Management", + "website": "https://github.com/OCA/stock-logistics-warehouse", + "author": "Eficent, Odoo Community Association (OCA)", + "license": "AGPL-3", + "application": False, + "installable": True, + "depends": [ + "stock_request", + "base_tier_validation", + ], + "data": [ + "data/stock_request_tier_definition.xml", + "views/stock_request_order_view.xml", + "views/stock_request_view.xml", + ], +} diff --git a/stock_request_tier_validation/data/stock_request_tier_definition.xml b/stock_request_tier_validation/data/stock_request_tier_definition.xml new file mode 100644 index 000000000..258a1b501 --- /dev/null +++ b/stock_request_tier_validation/data/stock_request_tier_definition.xml @@ -0,0 +1,24 @@ + + + + + + + + 1==1 + group + + False + + + + + 1==1 + group + + False + + + + diff --git a/stock_request_tier_validation/models/__init__.py b/stock_request_tier_validation/models/__init__.py new file mode 100644 index 000000000..0eea293f2 --- /dev/null +++ b/stock_request_tier_validation/models/__init__.py @@ -0,0 +1,5 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import stock_request +from . import stock_request_order +from . import tier_definition diff --git a/stock_request_tier_validation/models/stock_request.py b/stock_request_tier_validation/models/stock_request.py new file mode 100644 index 000000000..62226320f --- /dev/null +++ b/stock_request_tier_validation/models/stock_request.py @@ -0,0 +1,16 @@ +# Copyright 2019 Eficent Business and IT Consulting Services S.L. +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from odoo import api, models + + +class StockRequest(models.Model): + _name = "stock.request" + _inherit = ['stock.request', 'tier.validation'] + _state_from = ['draft'] + _state_to = ['open'] + + @api.model + def _get_under_validation_exceptions(self): + res = super(StockRequest, self)._get_under_validation_exceptions() + res.append('route_id') + return res diff --git a/stock_request_tier_validation/models/stock_request_order.py b/stock_request_tier_validation/models/stock_request_order.py new file mode 100644 index 000000000..223ccfc0b --- /dev/null +++ b/stock_request_tier_validation/models/stock_request_order.py @@ -0,0 +1,16 @@ +# Copyright 2019 Eficent Business and IT Consulting Services S.L. +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from odoo import api, models + + +class StockRequest(models.Model): + _name = "stock.request.order" + _inherit = ['stock.request.order', 'tier.validation'] + _state_from = ['draft'] + _state_to = ['open'] + + @api.model + def _get_under_validation_exceptions(self): + res = super(StockRequest, self)._get_under_validation_exceptions() + res.append('route_id') + return res diff --git a/stock_request_tier_validation/models/tier_definition.py b/stock_request_tier_validation/models/tier_definition.py new file mode 100644 index 000000000..81aa03d80 --- /dev/null +++ b/stock_request_tier_validation/models/tier_definition.py @@ -0,0 +1,13 @@ +# Copyright 2019 Eficent Business and IT Consulting Services S.L. +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from odoo import api, models + + +class TierDefinition(models.Model): + _inherit = "tier.definition" + + @api.model + def _get_tier_validation_model_names(self): + res = super(TierDefinition, self)._get_tier_validation_model_names() + res.extend(("stock.request", "stock.request.order")) + return res diff --git a/stock_request_tier_validation/readme/CONFIGURE.rst b/stock_request_tier_validation/readme/CONFIGURE.rst new file mode 100644 index 000000000..090ea5bdb --- /dev/null +++ b/stock_request_tier_validation/readme/CONFIGURE.rst @@ -0,0 +1,7 @@ +A default tier is created allowing Stock Request Manager to approve Stock +Request and Stock Request Orders. + +In addition, you may want to add more tiers, so: + +#. Go to *Settings > Technical > Tier Validations > Tier Definition*. +#. Create as many tiers as you want for Purchase Order model. diff --git a/stock_request_tier_validation/readme/CONTRIBUTORS.rst b/stock_request_tier_validation/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..8e6bf8cfb --- /dev/null +++ b/stock_request_tier_validation/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* Lois Rilo +* Héctor Villarreal + diff --git a/stock_request_tier_validation/readme/CREDITS.rst b/stock_request_tier_validation/readme/CREDITS.rst new file mode 100644 index 000000000..81aa6f7d3 --- /dev/null +++ b/stock_request_tier_validation/readme/CREDITS.rst @@ -0,0 +1,4 @@ +Images +------ + +* Enric Tobella (logo) diff --git a/stock_request_tier_validation/readme/DESCRIPTION.rst b/stock_request_tier_validation/readme/DESCRIPTION.rst new file mode 100644 index 000000000..feb88347c --- /dev/null +++ b/stock_request_tier_validation/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +This module extends the functionality of Stock Requests and Stock Request +Orders to support a tier validation process. diff --git a/stock_request_tier_validation/readme/INSTALL.rst b/stock_request_tier_validation/readme/INSTALL.rst new file mode 100644 index 000000000..638fbd2d6 --- /dev/null +++ b/stock_request_tier_validation/readme/INSTALL.rst @@ -0,0 +1,2 @@ +This module depends on ``base_tier_validation``. You can find it at +`OCA/server-ux `_ diff --git a/stock_request_tier_validation/readme/USAGE.rst b/stock_request_tier_validation/readme/USAGE.rst new file mode 100644 index 000000000..c47071d98 --- /dev/null +++ b/stock_request_tier_validation/readme/USAGE.rst @@ -0,0 +1,14 @@ +To use this module, you need to: + +#. Create a Stock Request triggering at least one "Tier Definition". +#. Click on *Request Validation* button. +#. Under the tab *Reviews* have a look to pending reviews and their statuses. +#. Once all reviews are validated button to *Confirm* will be shown. + +Additional features: + +* You can filter the Stock Request requesting your review through the filter *Needs my + Review*. +* User with rights to confirm the Stock Request (validate all tiers that would + be generated) can directly do the operation, this is, there is no need for + her/him to request a validation. diff --git a/stock_request_tier_validation/static/description/icon.png b/stock_request_tier_validation/static/description/icon.png new file mode 100644 index 000000000..c31ecfd9f Binary files /dev/null and b/stock_request_tier_validation/static/description/icon.png differ diff --git a/stock_request_tier_validation/static/description/index.html b/stock_request_tier_validation/static/description/index.html new file mode 100644 index 000000000..a5b9a390e --- /dev/null +++ b/stock_request_tier_validation/static/description/index.html @@ -0,0 +1,470 @@ + + + + + + +Stock Request Tier Validation + + + +
+

Stock Request Tier Validation

+ + +

Beta License: AGPL-3 OCA/stock-logistics-warehouse Translate me on Weblate Try me on Runbot

+

This module extends the functionality of Stock Requests and Stock Request +Orders to support a tier validation process.

+

Table of contents

+ +
+

Installation

+

This module depends on base_tier_validation. You can find it at +OCA/server-ux

+
+
+

Configuration

+

A default tier is created allowing Stock Request Manager to approve Stock +Request and Stock Request Orders.

+

In addition, you may want to add more tiers, so:

+
    +
  1. Go to Settings > Technical > Tier Validations > Tier Definition.
  2. +
  3. Create as many tiers as you want for Purchase Order model.
  4. +
+
+
+

Usage

+

To use this module, you need to:

+
    +
  1. Create a Stock Request triggering at least one “Tier Definition”.
  2. +
  3. Click on Request Validation button.
  4. +
  5. Under the tab Reviews have a look to pending reviews and their statuses.
  6. +
  7. Once all reviews are validated button to Confirm will be shown.
  8. +
+

Additional features:

+
    +
  • You can filter the Stock Request requesting your review through the filter Needs my +Review.
  • +
  • User with rights to confirm the Stock Request (validate all tiers that would +be generated) can directly do the operation, this is, there is no need for +her/him to request a validation.
  • +
+
+
+

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

+
    +
  • Eficent
  • +
+
+
+

Contributors

+ +
+
+

Other credits

+
+

Images

+
    +
  • Enric Tobella (logo)
  • +
+
+
+
+

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/stock-logistics-warehouse project on GitHub.

+

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

+
+
+
+ + diff --git a/stock_request_tier_validation/tests/__init__.py b/stock_request_tier_validation/tests/__init__.py new file mode 100644 index 000000000..645f62cfc --- /dev/null +++ b/stock_request_tier_validation/tests/__init__.py @@ -0,0 +1 @@ +from . import test_stock_request_tier_validation \ No newline at end of file diff --git a/stock_request_tier_validation/tests/test_stock_request_tier_validation.py b/stock_request_tier_validation/tests/test_stock_request_tier_validation.py new file mode 100644 index 000000000..b3de6fdf5 --- /dev/null +++ b/stock_request_tier_validation/tests/test_stock_request_tier_validation.py @@ -0,0 +1,26 @@ +# Copyright 2017 Eficent Business and IT Consulting Services S.L. +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0). + +from odoo.tests import common + + +class TestStockRequest(common.TransactionCase): + def setUp(self): + super(TestStockRequest, self).setUp() + + # common models + self.stock_request = self.env['stock.request'] + self.request_order = self.env['stock.request.order'] + self.tier_definition = self.env['tier.definition'] + + def test_get_under_validation_exceptions(self): + self.assertIn('route_id', + self.stock_request._get_under_validation_exceptions()) + self.assertIn('route_id', + self.request_order._get_under_validation_exceptions()) + + def test_get_tier_validation_model_names(self): + self.assertIn('stock.request', + self.tier_definition._get_tier_validation_model_names()) + self.assertIn('stock.request.order', + self.tier_definition._get_tier_validation_model_names()) diff --git a/stock_request_tier_validation/views/stock_request_order_view.xml b/stock_request_tier_validation/views/stock_request_order_view.xml new file mode 100644 index 000000000..2b070a5da --- /dev/null +++ b/stock_request_tier_validation/views/stock_request_order_view.xml @@ -0,0 +1,88 @@ + + + + + + stock.request.order.tier.validation.form + stock.request.order + + + + +
+ + + +
+

This Stock Request needs to be + validated. + +

+
+

Operation has been validated!

+
+
+

Operation has been rejected.

+
+
+ + + + + +
+
+ + + stock.request.select - stock_request_tier_validation + stock.request + + + + + + + + + + + +
diff --git a/stock_request_tier_validation/views/stock_request_view.xml b/stock_request_tier_validation/views/stock_request_view.xml new file mode 100644 index 000000000..6f7cf931f --- /dev/null +++ b/stock_request_tier_validation/views/stock_request_view.xml @@ -0,0 +1,88 @@ + + + + + + stock.request.tier.validation.form + stock.request + + + + +
+ + + +
+

This Stock Request needs to be + validated. + +

+
+

Operation has been validated!

+
+
+

Operation has been rejected.

+
+
+ + + + + +
+
+ + + stock.request.select - stock_request_tier_validation + stock.request + + + + + + + + + + + +