diff --git a/mrp_production_putaway_strategy/README.rst b/mrp_production_putaway_strategy/README.rst new file mode 100644 index 000000000..be19d4d90 --- /dev/null +++ b/mrp_production_putaway_strategy/README.rst @@ -0,0 +1,80 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: https://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 new file mode 100644 index 000000000..149f4e4fd --- /dev/null +++ b/mrp_production_putaway_strategy/__init__.py @@ -0,0 +1,4 @@ +# -*- 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 new file mode 100644 index 000000000..f42d9c0b2 --- /dev/null +++ b/mrp_production_putaway_strategy/__manifest__.py @@ -0,0 +1,17 @@ +# -*- 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). + +{ + "name": "MRP Production Putaway Strategy", + "summary": "Applies putaway strategies to manufacturing orders for " + "finished products.", + "version": "10.0.1.0.0", + "author": "Eficent, " + "Odoo Community Association (OCA)", + "website": "https://github.com/OCA/manufacture", + "category": "Manufacture", + "depends": ["mrp"], + "license": "AGPL-3", + "installable": True, +} diff --git a/mrp_production_putaway_strategy/i18n/de.po b/mrp_production_putaway_strategy/i18n/de.po new file mode 100644 index 000000000..71058944c --- /dev/null +++ b/mrp_production_putaway_strategy/i18n/de.po @@ -0,0 +1,30 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_production_putaway_strategy +# +# Translators: +# Niki Waibel , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-08-29 03:19+0000\n" +"PO-Revision-Date: 2017-08-29 03:19+0000\n" +"Last-Translator: Niki Waibel , 2017\n" +"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: de\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: mrp_production_putaway_strategy +#: code:addons/mrp_production_putaway_strategy/models/mrp_production.py:18 +#, python-format +msgid "Applied Putaway strategy to finished products location %s." +msgstr "" + +#. module: mrp_production_putaway_strategy +#: model:ir.model,name:mrp_production_putaway_strategy.model_mrp_production +msgid "Manufacturing Order" +msgstr "Fertigungsauftrag" diff --git a/mrp_production_putaway_strategy/i18n/es.po b/mrp_production_putaway_strategy/i18n/es.po new file mode 100644 index 000000000..61f4e2eeb --- /dev/null +++ b/mrp_production_putaway_strategy/i18n/es.po @@ -0,0 +1,30 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_production_putaway_strategy +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-08-29 03:19+0000\n" +"PO-Revision-Date: 2017-08-29 03:19+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: mrp_production_putaway_strategy +#: code:addons/mrp_production_putaway_strategy/models/mrp_production.py:18 +#, python-format +msgid "Applied Putaway strategy to finished products location %s." +msgstr "" + +#. module: mrp_production_putaway_strategy +#: model:ir.model,name:mrp_production_putaway_strategy.model_mrp_production +msgid "Manufacturing Order" +msgstr "Órden de fabricación" diff --git a/mrp_production_putaway_strategy/i18n/es_MX.po b/mrp_production_putaway_strategy/i18n/es_MX.po new file mode 100644 index 000000000..8b6c8876c --- /dev/null +++ b/mrp_production_putaway_strategy/i18n/es_MX.po @@ -0,0 +1,30 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_production_putaway_strategy +# +# Translators: +# Juan González , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-08-29 03:19+0000\n" +"PO-Revision-Date: 2017-08-29 03:19+0000\n" +"Last-Translator: Juan González , 2017\n" +"Language-Team: Spanish (Mexico) (https://www.transifex.com/oca/teams/23907/es_MX/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es_MX\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: mrp_production_putaway_strategy +#: code:addons/mrp_production_putaway_strategy/models/mrp_production.py:18 +#, python-format +msgid "Applied Putaway strategy to finished products location %s." +msgstr "" + +#. module: mrp_production_putaway_strategy +#: model:ir.model,name:mrp_production_putaway_strategy.model_mrp_production +msgid "Manufacturing Order" +msgstr "Orden de fabricación" diff --git a/mrp_production_putaway_strategy/i18n/fr.po b/mrp_production_putaway_strategy/i18n/fr.po new file mode 100644 index 000000000..c41f71761 --- /dev/null +++ b/mrp_production_putaway_strategy/i18n/fr.po @@ -0,0 +1,31 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_production_putaway_strategy +# +# Translators: +# yterrettaz , 2017 +# Quentin THEURET , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-08-29 03:19+0000\n" +"PO-Revision-Date: 2017-08-29 03:19+0000\n" +"Last-Translator: Quentin THEURET , 2017\n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: mrp_production_putaway_strategy +#: code:addons/mrp_production_putaway_strategy/models/mrp_production.py:18 +#, python-format +msgid "Applied Putaway strategy to finished products location %s." +msgstr "Stratégie de dépôt appliqué à l'emplacement des produits finis %s." + +#. module: mrp_production_putaway_strategy +#: model:ir.model,name:mrp_production_putaway_strategy.model_mrp_production +msgid "Manufacturing Order" +msgstr "Ordre de fabrication" diff --git a/mrp_production_putaway_strategy/i18n/gl.po b/mrp_production_putaway_strategy/i18n/gl.po new file mode 100644 index 000000000..83756feaf --- /dev/null +++ b/mrp_production_putaway_strategy/i18n/gl.po @@ -0,0 +1,30 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_production_putaway_strategy +# +# Translators: +# César Castro Cruz , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-08-29 03:19+0000\n" +"PO-Revision-Date: 2017-08-29 03:19+0000\n" +"Last-Translator: César Castro Cruz , 2017\n" +"Language-Team: Galician (https://www.transifex.com/oca/teams/23907/gl/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: gl\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: mrp_production_putaway_strategy +#: code:addons/mrp_production_putaway_strategy/models/mrp_production.py:18 +#, python-format +msgid "Applied Putaway strategy to finished products location %s." +msgstr "" + +#. module: mrp_production_putaway_strategy +#: model:ir.model,name:mrp_production_putaway_strategy.model_mrp_production +msgid "Manufacturing Order" +msgstr "Orde de fabricación" diff --git a/mrp_production_putaway_strategy/i18n/hr.po b/mrp_production_putaway_strategy/i18n/hr.po new file mode 100644 index 000000000..2c4cdce89 --- /dev/null +++ b/mrp_production_putaway_strategy/i18n/hr.po @@ -0,0 +1,30 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_production_putaway_strategy +# +# Translators: +# Bole , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-08-29 03:19+0000\n" +"PO-Revision-Date: 2017-08-29 03:19+0000\n" +"Last-Translator: Bole , 2017\n" +"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: hr\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: mrp_production_putaway_strategy +#: code:addons/mrp_production_putaway_strategy/models/mrp_production.py:18 +#, python-format +msgid "Applied Putaway strategy to finished products location %s." +msgstr "" + +#. module: mrp_production_putaway_strategy +#: model:ir.model,name:mrp_production_putaway_strategy.model_mrp_production +msgid "Manufacturing Order" +msgstr "Proizvodni nalog" diff --git a/mrp_production_putaway_strategy/i18n/it.po b/mrp_production_putaway_strategy/i18n/it.po new file mode 100644 index 000000000..0141cecc6 --- /dev/null +++ b/mrp_production_putaway_strategy/i18n/it.po @@ -0,0 +1,30 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_production_putaway_strategy +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-08-29 03:19+0000\n" +"PO-Revision-Date: 2017-08-29 03:19+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: it\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: mrp_production_putaway_strategy +#: code:addons/mrp_production_putaway_strategy/models/mrp_production.py:18 +#, python-format +msgid "Applied Putaway strategy to finished products location %s." +msgstr "" + +#. module: mrp_production_putaway_strategy +#: model:ir.model,name:mrp_production_putaway_strategy.model_mrp_production +msgid "Manufacturing Order" +msgstr "Ordine di produzione" diff --git a/mrp_production_putaway_strategy/i18n/pt_BR.po b/mrp_production_putaway_strategy/i18n/pt_BR.po new file mode 100644 index 000000000..723d2b492 --- /dev/null +++ b/mrp_production_putaway_strategy/i18n/pt_BR.po @@ -0,0 +1,30 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_production_putaway_strategy +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-08-29 03:19+0000\n" +"PO-Revision-Date: 2017-08-29 03:19+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/23907/pt_BR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: pt_BR\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: mrp_production_putaway_strategy +#: code:addons/mrp_production_putaway_strategy/models/mrp_production.py:18 +#, python-format +msgid "Applied Putaway strategy to finished products location %s." +msgstr "" + +#. module: mrp_production_putaway_strategy +#: model:ir.model,name:mrp_production_putaway_strategy.model_mrp_production +msgid "Manufacturing Order" +msgstr "Ordem de Produção" diff --git a/mrp_production_putaway_strategy/i18n/ro.po b/mrp_production_putaway_strategy/i18n/ro.po new file mode 100644 index 000000000..056e2d228 --- /dev/null +++ b/mrp_production_putaway_strategy/i18n/ro.po @@ -0,0 +1,30 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_production_putaway_strategy +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-08-29 03:19+0000\n" +"PO-Revision-Date: 2017-08-29 03:19+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Romanian (https://www.transifex.com/oca/teams/23907/ro/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: ro\n" +"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n" + +#. module: mrp_production_putaway_strategy +#: code:addons/mrp_production_putaway_strategy/models/mrp_production.py:18 +#, python-format +msgid "Applied Putaway strategy to finished products location %s." +msgstr "" + +#. module: mrp_production_putaway_strategy +#: model:ir.model,name:mrp_production_putaway_strategy.model_mrp_production +msgid "Manufacturing Order" +msgstr "Comandă fabricație" diff --git a/mrp_production_putaway_strategy/i18n/sl.po b/mrp_production_putaway_strategy/i18n/sl.po new file mode 100644 index 000000000..b2df9bbd1 --- /dev/null +++ b/mrp_production_putaway_strategy/i18n/sl.po @@ -0,0 +1,30 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_production_putaway_strategy +# +# Translators: +# Matjaž Mozetič , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-08-29 03:19+0000\n" +"PO-Revision-Date: 2017-08-29 03:19+0000\n" +"Last-Translator: Matjaž Mozetič , 2017\n" +"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: sl\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" + +#. module: mrp_production_putaway_strategy +#: code:addons/mrp_production_putaway_strategy/models/mrp_production.py:18 +#, python-format +msgid "Applied Putaway strategy to finished products location %s." +msgstr "" + +#. module: mrp_production_putaway_strategy +#: model:ir.model,name:mrp_production_putaway_strategy.model_mrp_production +msgid "Manufacturing Order" +msgstr "Proizvodni nalog" diff --git a/mrp_production_putaway_strategy/i18n/tr.po b/mrp_production_putaway_strategy/i18n/tr.po new file mode 100644 index 000000000..06d75755b --- /dev/null +++ b/mrp_production_putaway_strategy/i18n/tr.po @@ -0,0 +1,30 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_production_putaway_strategy +# +# Translators: +# Ozge Altinisik , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-08-29 03:19+0000\n" +"PO-Revision-Date: 2017-08-29 03:19+0000\n" +"Last-Translator: Ozge Altinisik , 2017\n" +"Language-Team: Turkish (https://www.transifex.com/oca/teams/23907/tr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: tr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: mrp_production_putaway_strategy +#: code:addons/mrp_production_putaway_strategy/models/mrp_production.py:18 +#, python-format +msgid "Applied Putaway strategy to finished products location %s." +msgstr "" + +#. module: mrp_production_putaway_strategy +#: model:ir.model,name:mrp_production_putaway_strategy.model_mrp_production +msgid "Manufacturing Order" +msgstr "Üretim emri" diff --git a/mrp_production_putaway_strategy/i18n/vi_VN.po b/mrp_production_putaway_strategy/i18n/vi_VN.po new file mode 100644 index 000000000..5bada368d --- /dev/null +++ b/mrp_production_putaway_strategy/i18n/vi_VN.po @@ -0,0 +1,30 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_production_putaway_strategy +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-08-29 03:19+0000\n" +"PO-Revision-Date: 2017-08-29 03:19+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Vietnamese (Viet Nam) (https://www.transifex.com/oca/teams/23907/vi_VN/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: vi_VN\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#. module: mrp_production_putaway_strategy +#: code:addons/mrp_production_putaway_strategy/models/mrp_production.py:18 +#, python-format +msgid "Applied Putaway strategy to finished products location %s." +msgstr "" + +#. module: mrp_production_putaway_strategy +#: model:ir.model,name:mrp_production_putaway_strategy.model_mrp_production +msgid "Manufacturing Order" +msgstr "Lệnh sản xuất" diff --git a/mrp_production_putaway_strategy/i18n/zh_CN.po b/mrp_production_putaway_strategy/i18n/zh_CN.po new file mode 100644 index 000000000..2ad01399a --- /dev/null +++ b/mrp_production_putaway_strategy/i18n/zh_CN.po @@ -0,0 +1,30 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * mrp_production_putaway_strategy +# +# Translators: +# Jeffery CHEN , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-08-29 03:19+0000\n" +"PO-Revision-Date: 2017-08-29 03:19+0000\n" +"Last-Translator: Jeffery CHEN , 2017\n" +"Language-Team: Chinese (China) (https://www.transifex.com/oca/teams/23907/zh_CN/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: zh_CN\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#. module: mrp_production_putaway_strategy +#: code:addons/mrp_production_putaway_strategy/models/mrp_production.py:18 +#, python-format +msgid "Applied Putaway strategy to finished products location %s." +msgstr "" + +#. module: mrp_production_putaway_strategy +#: model:ir.model,name:mrp_production_putaway_strategy.model_mrp_production +msgid "Manufacturing Order" +msgstr "制造订单" diff --git a/mrp_production_putaway_strategy/models/__init__.py b/mrp_production_putaway_strategy/models/__init__.py new file mode 100644 index 000000000..628baff40 --- /dev/null +++ b/mrp_production_putaway_strategy/models/__init__.py @@ -0,0 +1,4 @@ +# -*- 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 new file mode 100644 index 000000000..42d2a52a1 --- /dev/null +++ b/mrp_production_putaway_strategy/models/mrp_production.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# © 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, _ + + +class MrpProduction(models.Model): + _inherit = 'mrp.production' + + @api.model + def create(self, vals): + location_dest = self.env['stock.location'].browse(vals.get( + 'location_dest_id')) + 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 + mo = super(MrpProduction, self).create(vals) + if location_id: + message = _( + "Applied Putaway strategy to finished products.\n" + "Finished Products Location: %s." % + mo.location_dest_id.complete_name) + mo.message_post(message, message_type='comment') + return mo diff --git a/mrp_production_putaway_strategy/static/description/icon.png b/mrp_production_putaway_strategy/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/mrp_production_putaway_strategy/static/description/icon.png differ diff --git a/mrp_production_putaway_strategy/tests/__init__.py b/mrp_production_putaway_strategy/tests/__init__.py new file mode 100644 index 000000000..96c2b358f --- /dev/null +++ b/mrp_production_putaway_strategy/tests/__init__.py @@ -0,0 +1,5 @@ +# -*- 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 new file mode 100644 index 000000000..adf8b0b2c --- /dev/null +++ b/mrp_production_putaway_strategy/tests/test_mrp_production.py @@ -0,0 +1,74 @@ +# -*- coding: utf-8 -*- +# © 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 + + +class MrpProductionCase(TransactionCase): + + def setUp(self, *args, **kwargs): + super(MrpProductionCase, self).setUp(*args, **kwargs) + + self.warehouse = self.env["stock.warehouse"].create({ + "name": "X Warehouse", + "code": "X WH", + "reception_steps": "one_step", + "delivery_steps": "ship_only", + "resupply_from_wh": False, + "default_resupply_wh_id": False, + }) + + self.category = self.env['product.category'].create({'name': 'Test'}) + + self.loc_stock = self.warehouse.lot_stock_id + self.bin_loc_stock = self.env['stock.location'].create({ + 'name': 'Bin 1', + 'location_id': self.loc_stock.id, + 'usage': 'internal' + }) + + self.putaway_strategy = self.env['product.putaway'].create({ + 'name': 'Fixed Loc', + 'method': 'fixed', + 'fixed_location_ids': [( + 0, 0, {'fixed_location_id': self.bin_loc_stock.id, + 'category_id': self.category.id})] + }) + self.loc_stock.putaway_strategy_id = self.putaway_strategy + + self.loc_production = self.env.ref( + "stock.location_production") + self.product1 = self.env.ref("mrp.product_product_19") + self.product1.categ_id = self.category + self.bom1 = self.env.ref("mrp.mrp_bom_3") + + def _create_mo(self, product=False, bom=False, src_loc=False, + dest_loc=False, qty=10.0, uom=False): + if not product: + product = self.product1 + uom = product.uom_id or uom + if not bom: + bom = self.bom1 + if not src_loc: + src_loc = self.loc_stock + if not dest_loc: + dest_loc = self.loc_stock + res = { + "product_id": product.id, + "bom_id": bom.id, + "location_src_id": src_loc.id, + "location_dest_id": dest_loc.id, + "product_qty": qty, + "product_uom_id": uom.id, + } + return self.env['mrp.production'].create(res) + + def test_putaway_strategy_01(self): + """Tests if the putaway strategy applies to a Manufacturing Order.""" + # Create MO + mo = self._create_mo() + for finished in mo.move_finished_ids: + self.assertEqual( + finished.location_dest_id, self.bin_loc_stock, + "Putaway strategy hasn't been applied.")