From f08a4a1ad8c83539bf870857980c875e450db3d9 Mon Sep 17 00:00:00 2001 From: Lois Rilo Date: Mon, 7 May 2018 13:28:15 +0200 Subject: [PATCH] [11.0][MIG] mrp_production_putaway_strategy --- mrp_production_putaway_strategy/README.rst | 80 ------------------- mrp_production_putaway_strategy/__init__.py | 3 - .../__manifest__.py | 7 +- .../models/__init__.py | 3 - .../models/mrp_production.py | 5 +- .../readme/CONFIGURE.rst | 9 +++ .../readme/CONTRIBUTORS.rst | 2 + .../readme/DESCRIPTION.rst | 6 ++ .../readme/USAGE.rst | 8 ++ .../tests/__init__.py | 4 - .../tests/test_mrp_production.py | 3 +- 11 files changed, 31 insertions(+), 99 deletions(-) delete mode 100644 mrp_production_putaway_strategy/README.rst create mode 100644 mrp_production_putaway_strategy/readme/CONFIGURE.rst create mode 100644 mrp_production_putaway_strategy/readme/CONTRIBUTORS.rst create mode 100644 mrp_production_putaway_strategy/readme/DESCRIPTION.rst create mode 100644 mrp_production_putaway_strategy/readme/USAGE.rst diff --git a/mrp_production_putaway_strategy/README.rst b/mrp_production_putaway_strategy/README.rst deleted file mode 100644 index e20ecc5d5..000000000 --- a/mrp_production_putaway_strategy/README.rst +++ /dev/null @@ -1,80 +0,0 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html - :alt: License: AGPL-3 - -=============================== -MRP Production Putaway Strategy -=============================== - -This module allows to apply putaway strategies to the products resulting from -the manufacturing orders. - -The finished products will be placed in the location designated by the putaway -strategy (if they do not have another destination move), based on the -finished products location that was defined in the manufacturing order. - -Configuration -============= - -To configure a putaway strategy follow the next steps: - -#. Go to 'Inventory / Settings' and activate the option 'Advanced routing of - products using rules'. -#. Define a putaway strategy in the location zone where the finished products - are supposed to be placed, and indicate the specific sub-location/bin - where the products should be placed. - -Usage -===== - -To use this module proceed as follows: - -#. Create a manufacturing order and indicate the product and the finished - products location zone. -#. Confirm the manufacturing order. -#. You will notice that the finished products location has changed to the - putaway location, and the chatter shows a message indicating that the - putaway strategy was applied. - -.. 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/10.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 smashing it by providing a detailed and welcomed feedback. - -Credits -======= - -Images ------- - -* Odoo Community Association: `Icon `_. - -Contributors ------------- - -* Jordi Ballester -* Lois Rilo - - -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_production_putaway_strategy/__init__.py b/mrp_production_putaway_strategy/__init__.py index 149f4e4fd..0650744f6 100644 --- a/mrp_production_putaway_strategy/__init__.py +++ b/mrp_production_putaway_strategy/__init__.py @@ -1,4 +1 @@ -# -*- coding: utf-8 -*- -# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). - from . import models diff --git a/mrp_production_putaway_strategy/__manifest__.py b/mrp_production_putaway_strategy/__manifest__.py index 828f7175f..f84bdedca 100644 --- a/mrp_production_putaway_strategy/__manifest__.py +++ b/mrp_production_putaway_strategy/__manifest__.py @@ -1,15 +1,14 @@ -# -*- coding: utf-8 -*- -# © 2017 Eficent Business and IT Consulting Services S.L. +# Copyright 2017 Eficent Business and IT Consulting Services S.L. # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). { "name": "MRP Production Putaway Strategy", "summary": "Applies putaway strategies to manufacturing orders for " "finished products.", - "version": "10.0.1.0.0", + "version": "11.0.1.0.0", "author": "Eficent, " "Odoo Community Association (OCA)", - "website": "http://www.eficent.com", + "website": "https://github.com/OCA/manufacture", "category": "Manufacture", "depends": ["mrp"], "license": "AGPL-3", diff --git a/mrp_production_putaway_strategy/models/__init__.py b/mrp_production_putaway_strategy/models/__init__.py index 628baff40..a9e5f13e4 100644 --- a/mrp_production_putaway_strategy/models/__init__.py +++ b/mrp_production_putaway_strategy/models/__init__.py @@ -1,4 +1 @@ -# -*- coding: utf-8 -*- -# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). - from . import mrp_production diff --git a/mrp_production_putaway_strategy/models/mrp_production.py b/mrp_production_putaway_strategy/models/mrp_production.py index 42d2a52a1..e7d84c224 100644 --- a/mrp_production_putaway_strategy/models/mrp_production.py +++ b/mrp_production_putaway_strategy/models/mrp_production.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# © 2017-18 Eficent Business and IT Consulting Services S.L. +# Copyright 2017-18 Eficent Business and IT Consulting Services S.L. # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import api, models, _ @@ -15,7 +14,7 @@ class MrpProduction(models.Model): product = self.env['product.product'].browse(vals.get('product_id')) location_id = location_dest.get_putaway_strategy(product) if location_id: - vals['location_dest_id'] = location_id + vals['location_dest_id'] = location_id.id mo = super(MrpProduction, self).create(vals) if location_id: message = _( diff --git a/mrp_production_putaway_strategy/readme/CONFIGURE.rst b/mrp_production_putaway_strategy/readme/CONFIGURE.rst new file mode 100644 index 000000000..260411ae1 --- /dev/null +++ b/mrp_production_putaway_strategy/readme/CONFIGURE.rst @@ -0,0 +1,9 @@ +To configure a putaway strategy follow the next steps: + +#. Go to 'Inventory / Settings'. Activate the option 'Multi-Step Routes' and + save. +#. Go again to 'Inventory / Settings' and press + 'Set Putaway Strategies on Locations'. Then define a putaway strategy in + the location zone where the finished products are supposed to be placed, + and indicate the specific sub-location/bin where the products should + be placed. diff --git a/mrp_production_putaway_strategy/readme/CONTRIBUTORS.rst b/mrp_production_putaway_strategy/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..6df2be2f8 --- /dev/null +++ b/mrp_production_putaway_strategy/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* Jordi Ballester +* Lois Rilo diff --git a/mrp_production_putaway_strategy/readme/DESCRIPTION.rst b/mrp_production_putaway_strategy/readme/DESCRIPTION.rst new file mode 100644 index 000000000..ba6b10ff5 --- /dev/null +++ b/mrp_production_putaway_strategy/readme/DESCRIPTION.rst @@ -0,0 +1,6 @@ +This module allows to apply putaway strategies to the products resulting from +the manufacturing orders. + +The finished products will be placed in the location designated by the putaway +strategy (if they do not have another destination move), based on the +finished products location that was defined in the manufacturing order. diff --git a/mrp_production_putaway_strategy/readme/USAGE.rst b/mrp_production_putaway_strategy/readme/USAGE.rst new file mode 100644 index 000000000..f89c1f14e --- /dev/null +++ b/mrp_production_putaway_strategy/readme/USAGE.rst @@ -0,0 +1,8 @@ +To use this module proceed as follows: + +#. Create a manufacturing order and indicate the product and the finished + products location zone. +#. Confirm the manufacturing order. +#. You will notice that the finished products location has changed to the + putaway location, and the chatter shows a message indicating that the + putaway strategy was applied. diff --git a/mrp_production_putaway_strategy/tests/__init__.py b/mrp_production_putaway_strategy/tests/__init__.py index 96c2b358f..fae3edd10 100644 --- a/mrp_production_putaway_strategy/tests/__init__.py +++ b/mrp_production_putaway_strategy/tests/__init__.py @@ -1,5 +1 @@ -# -*- coding: utf-8 -*- -# © 2017 Eficent Business and IT Consulting Services S.L. -# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). - from . import test_mrp_production diff --git a/mrp_production_putaway_strategy/tests/test_mrp_production.py b/mrp_production_putaway_strategy/tests/test_mrp_production.py index adf8b0b2c..8051c2102 100644 --- a/mrp_production_putaway_strategy/tests/test_mrp_production.py +++ b/mrp_production_putaway_strategy/tests/test_mrp_production.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# © 2017-18 Eficent Business and IT Consulting Services S.L. +# Copyright 2017-18 Eficent Business and IT Consulting Services S.L. # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo.tests.common import TransactionCase