diff --git a/procurement_auto_create_group/README.rst b/procurement_auto_create_group/README.rst new file mode 100644 index 000000000..c3b4c0ed0 --- /dev/null +++ b/procurement_auto_create_group/README.rst @@ -0,0 +1,103 @@ +============================= +Procurement Auto Create Group +============================= + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png + :target: https://odoo-community.org/page/development-status + :alt: Production/Stable +.. |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/13.0/procurement_auto_create_group + :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-13-0/stock-logistics-warehouse-13-0-procurement_auto_create_group + :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/13.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows the system to propose automatically new procurement groups +during the procurement run. + +This capability is important when you want to make sure that all the stock +moves resulting from a procurement run will never be mixed with moves from +other groups in stock transfers. + +The stock transfers resulting from the procurement run will +only contain stock moves created in that run. + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +#. Go to *Inventory / Configuration / Settings* and check the option + 'Multi-Step Routes' and press the 'Save' button. +#. Activate the developer mode. +#. Go to *Inventory / Configuration / Warehouse Management / Routes* + and select the route you want to change. Select the pull rule you wish + to change and Select 'Propagation of Procurement Group': 'Propagage'. + The checkbox 'Auto-create Procurement Group' will then appear and you can + set it if you want to procurement group to be automatically created. + +Usage +===== + +#. Run a new procurement and make sure that it determines a pull rule + with the option 'Auto-create Procurement Group' set. +#. When the procurement rule is executed, a procurement group with + format 'PG/000001' will be created. + +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 +~~~~~~~ + +* ForgeFlow + +Contributors +~~~~~~~~~~~~ + +* Jordi Ballester +* Lois Rilo +* Héctor Villarreal Ortega + +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/procurement_auto_create_group/__init__.py b/procurement_auto_create_group/__init__.py new file mode 100644 index 000000000..4b76c7b2d --- /dev/null +++ b/procurement_auto_create_group/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from . import models diff --git a/procurement_auto_create_group/__manifest__.py b/procurement_auto_create_group/__manifest__.py new file mode 100644 index 000000000..9d2d39dee --- /dev/null +++ b/procurement_auto_create_group/__manifest__.py @@ -0,0 +1,16 @@ +# Copyright 2017-2020 ForgeFlow, S.L. +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +{ + "name": "Procurement Auto Create Group", + "version": "14.0.1.0.0", + "development_status": "Production/Stable", + "license": "AGPL-3", + "summary": "Allows to configure the system to propose automatically new " + "procurement groups during the procurement run.", + "author": "ForgeFlow," "Odoo Community Association (OCA)", + "website": "https://github.com/OCA/stock-logistics-warehouse", + "category": "Warehouse", + "depends": ["stock"], + "data": ["views/procurement_view.xml"], + "installable": True, +} diff --git a/procurement_auto_create_group/i18n/cs_CZ.po b/procurement_auto_create_group/i18n/cs_CZ.po new file mode 100644 index 000000000..9ea00c03b --- /dev/null +++ b/procurement_auto_create_group/i18n/cs_CZ.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * procurement_auto_create_group +# +# Translators: +# Lukáš Spurný , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-02-27 11:37+0000\n" +"PO-Revision-Date: 2018-02-27 11:37+0000\n" +"Last-Translator: Lukáš Spurný , 2018\n" +"Language-Team: Czech (Czech Republic) (https://www.transifex.com/oca/" +"teams/23907/cs_CZ/)\n" +"Language: cs_CZ\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" + +#. module: procurement_auto_create_group +#: model:ir.model.fields,field_description:procurement_auto_create_group.field_stock_rule__auto_create_group +msgid "Auto-create Procurement Group" +msgstr "Automatické vytvoření skupiny nákupu" + +#. module: procurement_auto_create_group +#: code:addons/procurement_auto_create_group/models/procurement_group.py:0 +#, fuzzy, python-format +msgid "No sequence defined for procurement group." +msgstr "Nebyla definována žádná sekvence pro skupinu zakázek" + +#. module: procurement_auto_create_group +#: model:ir.model,name:procurement_auto_create_group.model_procurement_group +#, fuzzy +msgid "Procurement Group" +msgstr "Pravidlo zadávání zakázek" + +#. module: procurement_auto_create_group +#: model:ir.model,name:procurement_auto_create_group.model_stock_rule +msgid "Stock Rule" +msgstr "" + +#, fuzzy +#~ msgid "Procurement Requisition" +#~ msgstr "Pravidlo zadávání zakázek" + +#~ msgid "Procurement" +#~ msgstr "Zakázka" diff --git a/procurement_auto_create_group/i18n/de.po b/procurement_auto_create_group/i18n/de.po new file mode 100644 index 000000000..5e0a04e27 --- /dev/null +++ b/procurement_auto_create_group/i18n/de.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * procurement_auto_create_group +# +# Translators: +# OCA Transbot , 2017 +# Rudolf Schnapka , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-29 13:12+0000\n" +"PO-Revision-Date: 2017-06-29 13:12+0000\n" +"Last-Translator: Rudolf Schnapka , 2017\n" +"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: procurement_auto_create_group +#: model:ir.model.fields,field_description:procurement_auto_create_group.field_stock_rule__auto_create_group +msgid "Auto-create Procurement Group" +msgstr "Auto-Anlage Beschaffungsgruppe" + +#. module: procurement_auto_create_group +#: code:addons/procurement_auto_create_group/models/procurement_group.py:0 +#, fuzzy, python-format +msgid "No sequence defined for procurement group." +msgstr "Keine Reihenfolge in Beschaffungsgruppe festgelegt" + +#. module: procurement_auto_create_group +#: model:ir.model,name:procurement_auto_create_group.model_procurement_group +#, fuzzy +msgid "Procurement Group" +msgstr "Beschaffungsregel" + +#. module: procurement_auto_create_group +#: model:ir.model,name:procurement_auto_create_group.model_stock_rule +msgid "Stock Rule" +msgstr "" + +#, fuzzy +#~ msgid "Procurement Requisition" +#~ msgstr "Beschaffungsregel" + +#~ msgid "Procurement" +#~ msgstr "Beschaffung" diff --git a/procurement_auto_create_group/i18n/es.po b/procurement_auto_create_group/i18n/es.po new file mode 100644 index 000000000..0f4d8ac3e --- /dev/null +++ b/procurement_auto_create_group/i18n/es.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * procurement_auto_create_group +# +# Translators: +# OCA Transbot , 2018 +# enjolras , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-02-27 11:37+0000\n" +"PO-Revision-Date: 2018-02-27 11:37+0000\n" +"Last-Translator: enjolras , 2018\n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: procurement_auto_create_group +#: model:ir.model.fields,field_description:procurement_auto_create_group.field_stock_rule__auto_create_group +msgid "Auto-create Procurement Group" +msgstr "Crear grupo de abastecimiento automáticamene" + +#. module: procurement_auto_create_group +#: code:addons/procurement_auto_create_group/models/procurement_group.py:0 +#, fuzzy, python-format +msgid "No sequence defined for procurement group." +msgstr "No se ha definido una secuencia para el grupo de abastecimiento" + +#. module: procurement_auto_create_group +#: model:ir.model,name:procurement_auto_create_group.model_procurement_group +#, fuzzy +msgid "Procurement Group" +msgstr "Regla de abastecimiento" + +#. module: procurement_auto_create_group +#: model:ir.model,name:procurement_auto_create_group.model_stock_rule +msgid "Stock Rule" +msgstr "" + +#, fuzzy +#~ msgid "Procurement Requisition" +#~ msgstr "Regla de abastecimiento" + +#~ msgid "Procurement" +#~ msgstr "Abastecimiento" diff --git a/procurement_auto_create_group/i18n/es_MX.po b/procurement_auto_create_group/i18n/es_MX.po new file mode 100644 index 000000000..7ff53f863 --- /dev/null +++ b/procurement_auto_create_group/i18n/es_MX.po @@ -0,0 +1,42 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * procurement_auto_create_group +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-24 03:04+0000\n" +"PO-Revision-Date: 2017-06-24 03:04+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Spanish (Mexico) (https://www.transifex.com/oca/teams/23907/" +"es_MX/)\n" +"Language: es_MX\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: procurement_auto_create_group +#: model:ir.model.fields,field_description:procurement_auto_create_group.field_stock_rule__auto_create_group +msgid "Auto-create Procurement Group" +msgstr "" + +#. module: procurement_auto_create_group +#: code:addons/procurement_auto_create_group/models/procurement_group.py:0 +#, python-format +msgid "No sequence defined for procurement group." +msgstr "" + +#. module: procurement_auto_create_group +#: model:ir.model,name:procurement_auto_create_group.model_procurement_group +#, fuzzy +msgid "Procurement Group" +msgstr "Contratación" + +#. module: procurement_auto_create_group +#: model:ir.model,name:procurement_auto_create_group.model_stock_rule +msgid "Stock Rule" +msgstr "" diff --git a/procurement_auto_create_group/i18n/fr.po b/procurement_auto_create_group/i18n/fr.po new file mode 100644 index 000000000..cc51f63ad --- /dev/null +++ b/procurement_auto_create_group/i18n/fr.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * procurement_auto_create_group +# +# Translators: +# OCA Transbot , 2018 +# Quentin THEURET , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-02-27 11:37+0000\n" +"PO-Revision-Date: 2019-08-06 14:44+0000\n" +"Last-Translator: Alexandre Fayolle \n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 3.7.1\n" + +#. module: procurement_auto_create_group +#: model:ir.model.fields,field_description:procurement_auto_create_group.field_stock_rule__auto_create_group +msgid "Auto-create Procurement Group" +msgstr "Groupe de l'approvisionnement auto-généré" + +#. module: procurement_auto_create_group +#: code:addons/procurement_auto_create_group/models/procurement_group.py:0 +#, python-format +msgid "No sequence defined for procurement group." +msgstr "Pas de séquence définie pour le groupe d'approvisionnements." + +#. module: procurement_auto_create_group +#: model:ir.model,name:procurement_auto_create_group.model_procurement_group +msgid "Procurement Group" +msgstr "Groupe d'approvisionnement" + +#. module: procurement_auto_create_group +#: model:ir.model,name:procurement_auto_create_group.model_stock_rule +msgid "Stock Rule" +msgstr "Règle de stock" + +#, fuzzy +#~ msgid "Procurement Requisition" +#~ msgstr "Règle d'approvisionnement" + +#~ msgid "Procurement" +#~ msgstr "Procurement" diff --git a/procurement_auto_create_group/i18n/hr.po b/procurement_auto_create_group/i18n/hr.po new file mode 100644 index 000000000..57ee85147 --- /dev/null +++ b/procurement_auto_create_group/i18n/hr.po @@ -0,0 +1,50 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * procurement_auto_create_group +# +# Translators: +# OCA Transbot , 2018 +# Bole , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-02-27 11:37+0000\n" +"PO-Revision-Date: 2018-02-27 11:37+0000\n" +"Last-Translator: Bole , 2018\n" +"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \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: procurement_auto_create_group +#: model:ir.model.fields,field_description:procurement_auto_create_group.field_stock_rule__auto_create_group +msgid "Auto-create Procurement Group" +msgstr "Automatski kreiraj grupu nabave" + +#. module: procurement_auto_create_group +#: code:addons/procurement_auto_create_group/models/procurement_group.py:0 +#, fuzzy, python-format +msgid "No sequence defined for procurement group." +msgstr "Nema definiranog brojevnog kruga za grupe nabave" + +#. module: procurement_auto_create_group +#: model:ir.model,name:procurement_auto_create_group.model_procurement_group +#, fuzzy +msgid "Procurement Group" +msgstr "Pavilo nabave" + +#. module: procurement_auto_create_group +#: model:ir.model,name:procurement_auto_create_group.model_stock_rule +msgid "Stock Rule" +msgstr "" + +#, fuzzy +#~ msgid "Procurement Requisition" +#~ msgstr "Pavilo nabave" + +#~ msgid "Procurement" +#~ msgstr "Nabava" diff --git a/procurement_auto_create_group/i18n/it.po b/procurement_auto_create_group/i18n/it.po new file mode 100644 index 000000000..6df84fca6 --- /dev/null +++ b/procurement_auto_create_group/i18n/it.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * procurement_auto_create_group +# +# Translators: +# Paolo Valier , 2017 +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-24 03:04+0000\n" +"PO-Revision-Date: 2017-06-24 03:04+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: procurement_auto_create_group +#: model:ir.model.fields,field_description:procurement_auto_create_group.field_stock_rule__auto_create_group +msgid "Auto-create Procurement Group" +msgstr "" + +#. module: procurement_auto_create_group +#: code:addons/procurement_auto_create_group/models/procurement_group.py:0 +#, python-format +msgid "No sequence defined for procurement group." +msgstr "" + +#. module: procurement_auto_create_group +#: model:ir.model,name:procurement_auto_create_group.model_procurement_group +#, fuzzy +msgid "Procurement Group" +msgstr "Regola d'Approvvigionamento" + +#. module: procurement_auto_create_group +#: model:ir.model,name:procurement_auto_create_group.model_stock_rule +msgid "Stock Rule" +msgstr "" + +#, fuzzy +#~ msgid "Procurement Requisition" +#~ msgstr "Regola d'Approvvigionamento" + +#~ msgid "Procurement" +#~ msgstr "Approvvigionamento" diff --git a/procurement_auto_create_group/i18n/procurement_auto_create_group.pot b/procurement_auto_create_group/i18n/procurement_auto_create_group.pot new file mode 100644 index 000000000..29f56eaf2 --- /dev/null +++ b/procurement_auto_create_group/i18n/procurement_auto_create_group.pot @@ -0,0 +1,35 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * procurement_auto_create_group +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: procurement_auto_create_group +#: model:ir.model.fields,field_description:procurement_auto_create_group.field_stock_rule__auto_create_group +msgid "Auto-create Procurement Group" +msgstr "" + +#. module: procurement_auto_create_group +#: code:addons/procurement_auto_create_group/models/procurement_group.py:0 +#, python-format +msgid "No sequence defined for procurement group." +msgstr "" + +#. module: procurement_auto_create_group +#: model:ir.model,name:procurement_auto_create_group.model_procurement_group +msgid "Procurement Group" +msgstr "" + +#. module: procurement_auto_create_group +#: model:ir.model,name:procurement_auto_create_group.model_stock_rule +msgid "Stock Rule" +msgstr "" diff --git a/procurement_auto_create_group/i18n/pt_BR.po b/procurement_auto_create_group/i18n/pt_BR.po new file mode 100644 index 000000000..2f7e941f2 --- /dev/null +++ b/procurement_auto_create_group/i18n/pt_BR.po @@ -0,0 +1,42 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * procurement_auto_create_group +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-24 03:04+0000\n" +"PO-Revision-Date: 2017-06-24 03:04+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/" +"teams/23907/pt_BR/)\n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: procurement_auto_create_group +#: model:ir.model.fields,field_description:procurement_auto_create_group.field_stock_rule__auto_create_group +msgid "Auto-create Procurement Group" +msgstr "" + +#. module: procurement_auto_create_group +#: code:addons/procurement_auto_create_group/models/procurement_group.py:0 +#, python-format +msgid "No sequence defined for procurement group." +msgstr "" + +#. module: procurement_auto_create_group +#: model:ir.model,name:procurement_auto_create_group.model_procurement_group +#, fuzzy +msgid "Procurement Group" +msgstr "Aquisição" + +#. module: procurement_auto_create_group +#: model:ir.model,name:procurement_auto_create_group.model_stock_rule +msgid "Stock Rule" +msgstr "" diff --git a/procurement_auto_create_group/i18n/pt_PT.po b/procurement_auto_create_group/i18n/pt_PT.po new file mode 100644 index 000000000..635facc79 --- /dev/null +++ b/procurement_auto_create_group/i18n/pt_PT.po @@ -0,0 +1,42 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * procurement_auto_create_group +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-24 03:04+0000\n" +"PO-Revision-Date: 2017-06-24 03:04+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Portuguese (Portugal) (https://www.transifex.com/oca/" +"teams/23907/pt_PT/)\n" +"Language: pt_PT\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: procurement_auto_create_group +#: model:ir.model.fields,field_description:procurement_auto_create_group.field_stock_rule__auto_create_group +msgid "Auto-create Procurement Group" +msgstr "" + +#. module: procurement_auto_create_group +#: code:addons/procurement_auto_create_group/models/procurement_group.py:0 +#, python-format +msgid "No sequence defined for procurement group." +msgstr "" + +#. module: procurement_auto_create_group +#: model:ir.model,name:procurement_auto_create_group.model_procurement_group +#, fuzzy +msgid "Procurement Group" +msgstr "Aquisições" + +#. module: procurement_auto_create_group +#: model:ir.model,name:procurement_auto_create_group.model_stock_rule +msgid "Stock Rule" +msgstr "" diff --git a/procurement_auto_create_group/i18n/ro.po b/procurement_auto_create_group/i18n/ro.po new file mode 100644 index 000000000..7ed1bb780 --- /dev/null +++ b/procurement_auto_create_group/i18n/ro.po @@ -0,0 +1,42 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * procurement_auto_create_group +# +# Translators: +# Dorin Hongu , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-24 03:04+0000\n" +"PO-Revision-Date: 2017-06-24 03:04+0000\n" +"Last-Translator: Dorin Hongu , 2017\n" +"Language-Team: Romanian (https://www.transifex.com/oca/teams/23907/ro/)\n" +"Language: ro\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?" +"2:1));\n" + +#. module: procurement_auto_create_group +#: model:ir.model.fields,field_description:procurement_auto_create_group.field_stock_rule__auto_create_group +msgid "Auto-create Procurement Group" +msgstr "" + +#. module: procurement_auto_create_group +#: code:addons/procurement_auto_create_group/models/procurement_group.py:0 +#, python-format +msgid "No sequence defined for procurement group." +msgstr "" + +#. module: procurement_auto_create_group +#: model:ir.model,name:procurement_auto_create_group.model_procurement_group +#, fuzzy +msgid "Procurement Group" +msgstr "Aprovizionare" + +#. module: procurement_auto_create_group +#: model:ir.model,name:procurement_auto_create_group.model_stock_rule +msgid "Stock Rule" +msgstr "" diff --git a/procurement_auto_create_group/i18n/sk.po b/procurement_auto_create_group/i18n/sk.po new file mode 100644 index 000000000..bf87ca864 --- /dev/null +++ b/procurement_auto_create_group/i18n/sk.po @@ -0,0 +1,41 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * procurement_auto_create_group +# +# Translators: +# Jan Prokop , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-10-03 01:04+0000\n" +"PO-Revision-Date: 2017-10-03 01:04+0000\n" +"Last-Translator: Jan Prokop , 2017\n" +"Language-Team: Slovak (https://www.transifex.com/oca/teams/23907/sk/)\n" +"Language: sk\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" + +#. module: procurement_auto_create_group +#: model:ir.model.fields,field_description:procurement_auto_create_group.field_stock_rule__auto_create_group +msgid "Auto-create Procurement Group" +msgstr "" + +#. module: procurement_auto_create_group +#: code:addons/procurement_auto_create_group/models/procurement_group.py:0 +#, python-format +msgid "No sequence defined for procurement group." +msgstr "" + +#. module: procurement_auto_create_group +#: model:ir.model,name:procurement_auto_create_group.model_procurement_group +#, fuzzy +msgid "Procurement Group" +msgstr "Obstarávanie" + +#. module: procurement_auto_create_group +#: model:ir.model,name:procurement_auto_create_group.model_stock_rule +msgid "Stock Rule" +msgstr "" diff --git a/procurement_auto_create_group/i18n/sl.po b/procurement_auto_create_group/i18n/sl.po new file mode 100644 index 000000000..fca10bb6b --- /dev/null +++ b/procurement_auto_create_group/i18n/sl.po @@ -0,0 +1,50 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * procurement_auto_create_group +# +# Translators: +# Matjaž Mozetič , 2017 +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-24 03:04+0000\n" +"PO-Revision-Date: 2017-06-24 03:04+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" +"Language: sl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n" +"%100==4 ? 2 : 3);\n" + +#. module: procurement_auto_create_group +#: model:ir.model.fields,field_description:procurement_auto_create_group.field_stock_rule__auto_create_group +msgid "Auto-create Procurement Group" +msgstr "" + +#. module: procurement_auto_create_group +#: code:addons/procurement_auto_create_group/models/procurement_group.py:0 +#, python-format +msgid "No sequence defined for procurement group." +msgstr "" + +#. module: procurement_auto_create_group +#: model:ir.model,name:procurement_auto_create_group.model_procurement_group +#, fuzzy +msgid "Procurement Group" +msgstr "Oskrbovalno pravilo" + +#. module: procurement_auto_create_group +#: model:ir.model,name:procurement_auto_create_group.model_stock_rule +msgid "Stock Rule" +msgstr "" + +#, fuzzy +#~ msgid "Procurement Requisition" +#~ msgstr "Oskrbovalno pravilo" + +#~ msgid "Procurement" +#~ msgstr "Oskrba" diff --git a/procurement_auto_create_group/i18n/tr_TR.po b/procurement_auto_create_group/i18n/tr_TR.po new file mode 100644 index 000000000..802cd86a8 --- /dev/null +++ b/procurement_auto_create_group/i18n/tr_TR.po @@ -0,0 +1,42 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * procurement_auto_create_group +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-24 03:04+0000\n" +"PO-Revision-Date: 2017-06-24 03:04+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Turkish (Turkey) (https://www.transifex.com/oca/teams/23907/" +"tr_TR/)\n" +"Language: tr_TR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#. module: procurement_auto_create_group +#: model:ir.model.fields,field_description:procurement_auto_create_group.field_stock_rule__auto_create_group +msgid "Auto-create Procurement Group" +msgstr "" + +#. module: procurement_auto_create_group +#: code:addons/procurement_auto_create_group/models/procurement_group.py:0 +#, python-format +msgid "No sequence defined for procurement group." +msgstr "" + +#. module: procurement_auto_create_group +#: model:ir.model,name:procurement_auto_create_group.model_procurement_group +#, fuzzy +msgid "Procurement Group" +msgstr "Satın alma" + +#. module: procurement_auto_create_group +#: model:ir.model,name:procurement_auto_create_group.model_stock_rule +msgid "Stock Rule" +msgstr "" diff --git a/procurement_auto_create_group/i18n/vi_VN.po b/procurement_auto_create_group/i18n/vi_VN.po new file mode 100644 index 000000000..1837b02cc --- /dev/null +++ b/procurement_auto_create_group/i18n/vi_VN.po @@ -0,0 +1,42 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * procurement_auto_create_group +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-24 03:04+0000\n" +"PO-Revision-Date: 2017-06-24 03:04+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Vietnamese (Viet Nam) (https://www.transifex.com/oca/" +"teams/23907/vi_VN/)\n" +"Language: vi_VN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#. module: procurement_auto_create_group +#: model:ir.model.fields,field_description:procurement_auto_create_group.field_stock_rule__auto_create_group +msgid "Auto-create Procurement Group" +msgstr "" + +#. module: procurement_auto_create_group +#: code:addons/procurement_auto_create_group/models/procurement_group.py:0 +#, python-format +msgid "No sequence defined for procurement group." +msgstr "" + +#. module: procurement_auto_create_group +#: model:ir.model,name:procurement_auto_create_group.model_procurement_group +#, fuzzy +msgid "Procurement Group" +msgstr "Mua sắm / Cung ứng" + +#. module: procurement_auto_create_group +#: model:ir.model,name:procurement_auto_create_group.model_stock_rule +msgid "Stock Rule" +msgstr "" diff --git a/procurement_auto_create_group/i18n/zh_CN.po b/procurement_auto_create_group/i18n/zh_CN.po new file mode 100644 index 000000000..9d1656e68 --- /dev/null +++ b/procurement_auto_create_group/i18n/zh_CN.po @@ -0,0 +1,42 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * procurement_auto_create_group +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 9.0c\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-24 03:04+0000\n" +"PO-Revision-Date: 2019-09-19 16:33+0000\n" +"Last-Translator: 黎伟杰 <674416404@qq.com>\n" +"Language-Team: Chinese (China) (https://www.transifex.com/oca/teams/23907/" +"zh_CN/)\n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 3.8\n" + +#. module: procurement_auto_create_group +#: model:ir.model.fields,field_description:procurement_auto_create_group.field_stock_rule__auto_create_group +msgid "Auto-create Procurement Group" +msgstr "自动创建补货组" + +#. module: procurement_auto_create_group +#: code:addons/procurement_auto_create_group/models/procurement_group.py:0 +#, python-format +msgid "No sequence defined for procurement group." +msgstr "没有为补货组定义序列。" + +#. module: procurement_auto_create_group +#: model:ir.model,name:procurement_auto_create_group.model_procurement_group +msgid "Procurement Group" +msgstr "补货组" + +#. module: procurement_auto_create_group +#: model:ir.model,name:procurement_auto_create_group.model_stock_rule +msgid "Stock Rule" +msgstr "库存规则" diff --git a/procurement_auto_create_group/models/__init__.py b/procurement_auto_create_group/models/__init__.py new file mode 100644 index 000000000..e2b84e34a --- /dev/null +++ b/procurement_auto_create_group/models/__init__.py @@ -0,0 +1,4 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from . import stock_rule +from . import procurement_group diff --git a/procurement_auto_create_group/models/procurement_group.py b/procurement_auto_create_group/models/procurement_group.py new file mode 100644 index 000000000..57e9f957d --- /dev/null +++ b/procurement_auto_create_group/models/procurement_group.py @@ -0,0 +1,34 @@ +# Copyright 2017-2020 ForgeFlow, S.L. +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo import _, api, models +from odoo.exceptions import UserError + + +class ProcurementGroup(models.Model): + _inherit = "procurement.group" + + @api.model + def _get_rule(self, product_id, location_id, values): + result = super()._get_rule(product_id, location_id, values) + # If there isn't a date planned in the values it means that this + # method has been called outside of a procurement process. + if ( + result + and not values.get("group_id") + and result.auto_create_group + and values.get("date_planned") + ): + group_data = self._prepare_auto_procurement_group_data() + group = self.env["procurement.group"].create(group_data) + values["group_id"] = group + return result + + @api.model + def _prepare_auto_procurement_group_data(self): + name = self.env["ir.sequence"].next_by_code("procurement.group") or False + if not name: + raise UserError(_("No sequence defined for procurement group.")) + return { + "name": name, + } diff --git a/procurement_auto_create_group/models/stock_rule.py b/procurement_auto_create_group/models/stock_rule.py new file mode 100644 index 000000000..1bea0e51c --- /dev/null +++ b/procurement_auto_create_group/models/stock_rule.py @@ -0,0 +1,15 @@ +# Copyright 2017-2020 ForgeFlow, S.L. +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo import api, fields, models + + +class StockRule(models.Model): + _inherit = "stock.rule" + + auto_create_group = fields.Boolean(string="Auto-create Procurement Group") + + @api.onchange("group_propagation_option") + def _onchange_group_propagation_option(self): + if self.group_propagation_option != "propagate": + self.auto_create_group = False diff --git a/procurement_auto_create_group/readme/CONFIGURE.rst b/procurement_auto_create_group/readme/CONFIGURE.rst new file mode 100644 index 000000000..f4cfe39ea --- /dev/null +++ b/procurement_auto_create_group/readme/CONFIGURE.rst @@ -0,0 +1,8 @@ +#. Go to *Inventory / Configuration / Settings* and check the option + 'Multi-Step Routes' and press the 'Save' button. +#. Activate the developer mode. +#. Go to *Inventory / Configuration / Warehouse Management / Routes* + and select the route you want to change. Select the pull rule you wish + to change and Select 'Propagation of Procurement Group': 'Propagate'. + The checkbox 'Auto-create Procurement Group' will then appear and you can + set it if you want to procurement group to be automatically created. diff --git a/procurement_auto_create_group/readme/CONTRIBUTORS.rst b/procurement_auto_create_group/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..297b31618 --- /dev/null +++ b/procurement_auto_create_group/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* Jordi Ballester +* Lois Rilo +* Héctor Villarreal Ortega diff --git a/procurement_auto_create_group/readme/DESCRIPTION.rst b/procurement_auto_create_group/readme/DESCRIPTION.rst new file mode 100644 index 000000000..44f626612 --- /dev/null +++ b/procurement_auto_create_group/readme/DESCRIPTION.rst @@ -0,0 +1,9 @@ +This module allows the system to propose automatically new procurement groups +during the procurement run. + +This capability is important when you want to make sure that all the stock +moves resulting from a procurement run will never be mixed with moves from +other groups in stock transfers. + +The stock transfers resulting from the procurement run will +only contain stock moves created in that run. diff --git a/procurement_auto_create_group/readme/USAGE.rst b/procurement_auto_create_group/readme/USAGE.rst new file mode 100644 index 000000000..e21466128 --- /dev/null +++ b/procurement_auto_create_group/readme/USAGE.rst @@ -0,0 +1,4 @@ +#. Run a new procurement and make sure that it determines a pull rule + with the option 'Auto-create Procurement Group' set. +#. When the procurement rule is executed, a procurement group with + format 'PG/000001' will be created. diff --git a/procurement_auto_create_group/static/description/icon.png b/procurement_auto_create_group/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/procurement_auto_create_group/static/description/icon.png differ diff --git a/procurement_auto_create_group/static/description/index.html b/procurement_auto_create_group/static/description/index.html new file mode 100644 index 000000000..a221b5189 --- /dev/null +++ b/procurement_auto_create_group/static/description/index.html @@ -0,0 +1,451 @@ + + + + + + +Procurement Auto Create Group + + + +
+

Procurement Auto Create Group

+ + +

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

+

This module allows the system to propose automatically new procurement groups +during the procurement run.

+

This capability is important when you want to make sure that all the stock +moves resulting from a procurement run will never be mixed with moves from +other groups in stock transfers.

+

The stock transfers resulting from the procurement run will +only contain stock moves created in that run.

+

Table of contents

+ +
+

Configuration

+
    +
  1. Go to Inventory / Configuration / Settings and check the option +‘Multi-Step Routes’ and press the ‘Save’ button.
  2. +
  3. Activate the developer mode.
  4. +
  5. Go to Inventory / Configuration / Warehouse Management / Routes +and select the route you want to change. Select the pull rule you wish +to change and Select ‘Propagation of Procurement Group’: ‘Propagage’. +The checkbox ‘Auto-create Procurement Group’ will then appear and you can +set it if you want to procurement group to be automatically created.
  6. +
+
+
+

Usage

+
    +
  1. Run a new procurement and make sure that it determines a pull rule +with the option ‘Auto-create Procurement Group’ set.
  2. +
  3. When the procurement rule is executed, a procurement group with +format ‘PG/000001’ will be created.
  4. +
+
+
+

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

+
    +
  • ForgeFlow
  • +
+
+
+

Contributors

+ +
+
+

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/procurement_auto_create_group/tests/__init__.py b/procurement_auto_create_group/tests/__init__.py new file mode 100644 index 000000000..682e89fd7 --- /dev/null +++ b/procurement_auto_create_group/tests/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from . import test_auto_create diff --git a/procurement_auto_create_group/tests/test_auto_create.py b/procurement_auto_create_group/tests/test_auto_create.py new file mode 100644 index 000000000..4f8c1d9d2 --- /dev/null +++ b/procurement_auto_create_group/tests/test_auto_create.py @@ -0,0 +1,108 @@ +# Copyright 2017-2020 ForgeFlow, S.L. +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo.tests.common import TransactionCase + + +class TestProcurementAutoCreateGroup(TransactionCase): + def setUp(self): + super(TestProcurementAutoCreateGroup, self).setUp() + self.group_obj = self.env["procurement.group"] + self.rule_obj = self.env["stock.rule"] + self.route_obj = self.env["stock.location.route"] + self.move_obj = self.env["stock.move"] + self.product_obj = self.env["product.product"] + + self.warehouse = self.env.ref("stock.warehouse0") + self.location = self.env.ref("stock.stock_location_stock") + loc_components = self.env.ref("stock.stock_location_components") + picking_type_id = self.env.ref("stock.picking_type_internal").id + + # Create rules and routes: + route_auto = self.route_obj.create({"name": "Auto Create Group"}) + self.rule_1 = self.rule_obj.create( + { + "name": "rule with autocreate", + "route_id": route_auto.id, + "auto_create_group": True, + "action": "pull_push", + "warehouse_id": self.warehouse.id, + "picking_type_id": picking_type_id, + "location_id": self.location.id, + "location_src_id": loc_components.id, + } + ) + route_no_auto = self.route_obj.create({"name": "Not Auto Create Group"}) + self.rule_obj.create( + { + "name": "rule with no autocreate", + "route_id": route_no_auto.id, + "auto_create_group": False, + "action": "pull_push", + "warehouse_id": self.warehouse.id, + "picking_type_id": picking_type_id, + "location_id": self.location.id, + "location_src_id": loc_components.id, + } + ) + + # Prepare products: + self.prod_auto = self.product_obj.create( + { + "name": "Test Product 1", + "type": "product", + "route_ids": [(6, 0, [route_auto.id])], + } + ) + self.prod_no_auto = self.product_obj.create( + { + "name": "Test Product 2", + "type": "product", + "route_ids": [(6, 0, [route_no_auto.id])], + } + ) + + def _procure(self, product): + values = {} + self.group_obj.run( + [ + self.env["procurement.group"].Procurement( + product, + 5.0, + product.uom_id, + self.location, + "TEST", + "odoo tests", + self.env.company, + values, + ) + ] + ) + return True + + def test_01_no_auto_create_group(self): + """Test auto creation of group.""" + move = self.move_obj.search([("product_id", "=", self.prod_no_auto.id)]) + self.assertFalse(move) + self._procure(self.prod_no_auto) + move = self.move_obj.search([("product_id", "=", self.prod_no_auto.id)]) + self.assertTrue(move) + self.assertFalse( + move.group_id, "Procurement Group should not have been assigned." + ) + + def test_02_auto_create_group(self): + move = self.move_obj.search([("product_id", "=", self.prod_auto.id)]) + self.assertFalse(move) + self._procure(self.prod_auto) + move = self.move_obj.search([("product_id", "=", self.prod_auto.id)]) + self.assertTrue(move) + self.assertTrue(move.group_id, "Procurement Group not assigned.") + + def test_03_onchange_method(self): + """Test onchange method for stock rule.""" + proc_rule = self.rule_1 + self.assertTrue(proc_rule.auto_create_group) + proc_rule.write({"group_propagation_option": "none"}) + proc_rule._onchange_group_propagation_option() + self.assertFalse(proc_rule.auto_create_group) diff --git a/procurement_auto_create_group/views/procurement_view.xml b/procurement_auto_create_group/views/procurement_view.xml new file mode 100644 index 000000000..8c383639c --- /dev/null +++ b/procurement_auto_create_group/views/procurement_view.xml @@ -0,0 +1,16 @@ + + + + stock.rule.form - procurement_auto_create_group + stock.rule + + + + + + + +