mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
103
procurement_auto_create_group/README.rst
Normal file
103
procurement_auto_create_group/README.rst
Normal file
@@ -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 <https://github.com/OCA/stock-logistics-warehouse/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 <https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20procurement_auto_create_group%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
||||
|
||||
Do not contact contributors directly about support or help with technical issues.
|
||||
|
||||
Credits
|
||||
=======
|
||||
|
||||
Authors
|
||||
~~~~~~~
|
||||
|
||||
* ForgeFlow
|
||||
|
||||
Contributors
|
||||
~~~~~~~~~~~~
|
||||
|
||||
* Jordi Ballester <jordi.ballester@forgeflow.com>
|
||||
* Lois Rilo <lois.rilo@forgeflow.com>
|
||||
* Héctor Villarreal Ortega <hector.villarreal@forgeflow.com>
|
||||
|
||||
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 <https://github.com/OCA/stock-logistics-warehouse/tree/13.0/procurement_auto_create_group>`_ project on GitHub.
|
||||
|
||||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
||||
3
procurement_auto_create_group/__init__.py
Normal file
3
procurement_auto_create_group/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from . import models
|
||||
16
procurement_auto_create_group/__manifest__.py
Normal file
16
procurement_auto_create_group/__manifest__.py
Normal file
@@ -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,
|
||||
}
|
||||
49
procurement_auto_create_group/i18n/cs_CZ.po
Normal file
49
procurement_auto_create_group/i18n/cs_CZ.po
Normal file
@@ -0,0 +1,49 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * procurement_auto_create_group
|
||||
#
|
||||
# Translators:
|
||||
# Lukáš Spurný <lukasspurny8@gmail.com>, 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ý <lukasspurny8@gmail.com>, 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"
|
||||
49
procurement_auto_create_group/i18n/de.po
Normal file
49
procurement_auto_create_group/i18n/de.po
Normal file
@@ -0,0 +1,49 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * procurement_auto_create_group
|
||||
#
|
||||
# Translators:
|
||||
# OCA Transbot <transbot@odoo-community.org>, 2017
|
||||
# Rudolf Schnapka <rs@techno-flex.de>, 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 <rs@techno-flex.de>, 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"
|
||||
49
procurement_auto_create_group/i18n/es.po
Normal file
49
procurement_auto_create_group/i18n/es.po
Normal file
@@ -0,0 +1,49 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * procurement_auto_create_group
|
||||
#
|
||||
# Translators:
|
||||
# OCA Transbot <transbot@odoo-community.org>, 2018
|
||||
# enjolras <yo@miguelrevilla.com>, 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 <yo@miguelrevilla.com>, 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"
|
||||
42
procurement_auto_create_group/i18n/es_MX.po
Normal file
42
procurement_auto_create_group/i18n/es_MX.po
Normal file
@@ -0,0 +1,42 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * procurement_auto_create_group
|
||||
#
|
||||
# Translators:
|
||||
# OCA Transbot <transbot@odoo-community.org>, 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 <transbot@odoo-community.org>, 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 ""
|
||||
49
procurement_auto_create_group/i18n/fr.po
Normal file
49
procurement_auto_create_group/i18n/fr.po
Normal file
@@ -0,0 +1,49 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * procurement_auto_create_group
|
||||
#
|
||||
# Translators:
|
||||
# OCA Transbot <transbot@odoo-community.org>, 2018
|
||||
# Quentin THEURET <odoo@kerpeo.com>, 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 <alexandre.fayolle@camptocamp.com>\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"
|
||||
50
procurement_auto_create_group/i18n/hr.po
Normal file
50
procurement_auto_create_group/i18n/hr.po
Normal file
@@ -0,0 +1,50 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * procurement_auto_create_group
|
||||
#
|
||||
# Translators:
|
||||
# OCA Transbot <transbot@odoo-community.org>, 2018
|
||||
# Bole <bole@dajmi5.com>, 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 <bole@dajmi5.com>, 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"
|
||||
49
procurement_auto_create_group/i18n/it.po
Normal file
49
procurement_auto_create_group/i18n/it.po
Normal file
@@ -0,0 +1,49 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * procurement_auto_create_group
|
||||
#
|
||||
# Translators:
|
||||
# Paolo Valier <paolo.valier@hotmail.it>, 2017
|
||||
# OCA Transbot <transbot@odoo-community.org>, 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 <transbot@odoo-community.org>, 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"
|
||||
@@ -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 ""
|
||||
42
procurement_auto_create_group/i18n/pt_BR.po
Normal file
42
procurement_auto_create_group/i18n/pt_BR.po
Normal file
@@ -0,0 +1,42 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * procurement_auto_create_group
|
||||
#
|
||||
# Translators:
|
||||
# OCA Transbot <transbot@odoo-community.org>, 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 <transbot@odoo-community.org>, 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 ""
|
||||
42
procurement_auto_create_group/i18n/pt_PT.po
Normal file
42
procurement_auto_create_group/i18n/pt_PT.po
Normal file
@@ -0,0 +1,42 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * procurement_auto_create_group
|
||||
#
|
||||
# Translators:
|
||||
# OCA Transbot <transbot@odoo-community.org>, 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 <transbot@odoo-community.org>, 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 ""
|
||||
42
procurement_auto_create_group/i18n/ro.po
Normal file
42
procurement_auto_create_group/i18n/ro.po
Normal file
@@ -0,0 +1,42 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * procurement_auto_create_group
|
||||
#
|
||||
# Translators:
|
||||
# Dorin Hongu <dhongu@gmail.com>, 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 <dhongu@gmail.com>, 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 ""
|
||||
41
procurement_auto_create_group/i18n/sk.po
Normal file
41
procurement_auto_create_group/i18n/sk.po
Normal file
@@ -0,0 +1,41 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * procurement_auto_create_group
|
||||
#
|
||||
# Translators:
|
||||
# Jan Prokop <jprokop@creativehome.sk>, 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 <jprokop@creativehome.sk>, 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 ""
|
||||
50
procurement_auto_create_group/i18n/sl.po
Normal file
50
procurement_auto_create_group/i18n/sl.po
Normal file
@@ -0,0 +1,50 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * procurement_auto_create_group
|
||||
#
|
||||
# Translators:
|
||||
# Matjaž Mozetič <m.mozetic@matmoz.si>, 2017
|
||||
# OCA Transbot <transbot@odoo-community.org>, 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 <transbot@odoo-community.org>, 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"
|
||||
42
procurement_auto_create_group/i18n/tr_TR.po
Normal file
42
procurement_auto_create_group/i18n/tr_TR.po
Normal file
@@ -0,0 +1,42 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * procurement_auto_create_group
|
||||
#
|
||||
# Translators:
|
||||
# OCA Transbot <transbot@odoo-community.org>, 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 <transbot@odoo-community.org>, 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 ""
|
||||
42
procurement_auto_create_group/i18n/vi_VN.po
Normal file
42
procurement_auto_create_group/i18n/vi_VN.po
Normal file
@@ -0,0 +1,42 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * procurement_auto_create_group
|
||||
#
|
||||
# Translators:
|
||||
# OCA Transbot <transbot@odoo-community.org>, 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 <transbot@odoo-community.org>, 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 ""
|
||||
42
procurement_auto_create_group/i18n/zh_CN.po
Normal file
42
procurement_auto_create_group/i18n/zh_CN.po
Normal file
@@ -0,0 +1,42 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * procurement_auto_create_group
|
||||
#
|
||||
# Translators:
|
||||
# OCA Transbot <transbot@odoo-community.org>, 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 "库存规则"
|
||||
4
procurement_auto_create_group/models/__init__.py
Normal file
4
procurement_auto_create_group/models/__init__.py
Normal file
@@ -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
|
||||
34
procurement_auto_create_group/models/procurement_group.py
Normal file
34
procurement_auto_create_group/models/procurement_group.py
Normal file
@@ -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,
|
||||
}
|
||||
15
procurement_auto_create_group/models/stock_rule.py
Normal file
15
procurement_auto_create_group/models/stock_rule.py
Normal file
@@ -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
|
||||
8
procurement_auto_create_group/readme/CONFIGURE.rst
Normal file
8
procurement_auto_create_group/readme/CONFIGURE.rst
Normal file
@@ -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.
|
||||
3
procurement_auto_create_group/readme/CONTRIBUTORS.rst
Normal file
3
procurement_auto_create_group/readme/CONTRIBUTORS.rst
Normal file
@@ -0,0 +1,3 @@
|
||||
* Jordi Ballester <jordi.ballester@forgeflow.com>
|
||||
* Lois Rilo <lois.rilo@forgeflow.com>
|
||||
* Héctor Villarreal Ortega <hector.villarreal@forgeflow.com>
|
||||
9
procurement_auto_create_group/readme/DESCRIPTION.rst
Normal file
9
procurement_auto_create_group/readme/DESCRIPTION.rst
Normal file
@@ -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.
|
||||
4
procurement_auto_create_group/readme/USAGE.rst
Normal file
4
procurement_auto_create_group/readme/USAGE.rst
Normal file
@@ -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.
|
||||
BIN
procurement_auto_create_group/static/description/icon.png
Normal file
BIN
procurement_auto_create_group/static/description/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.2 KiB |
451
procurement_auto_create_group/static/description/index.html
Normal file
451
procurement_auto_create_group/static/description/index.html
Normal file
@@ -0,0 +1,451 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
|
||||
<title>Procurement Auto Create Group</title>
|
||||
<style type="text/css">
|
||||
|
||||
/*
|
||||
:Author: David Goodger (goodger@python.org)
|
||||
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
|
||||
:Copyright: This stylesheet has been placed in the public domain.
|
||||
|
||||
Default cascading style sheet for the HTML output of Docutils.
|
||||
|
||||
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
|
||||
customize this style sheet.
|
||||
*/
|
||||
|
||||
/* used to remove borders from tables and images */
|
||||
.borderless, table.borderless td, table.borderless th {
|
||||
border: 0 }
|
||||
|
||||
table.borderless td, table.borderless th {
|
||||
/* Override padding for "table.docutils td" with "! important".
|
||||
The right padding separates the table cells. */
|
||||
padding: 0 0.5em 0 0 ! important }
|
||||
|
||||
.first {
|
||||
/* Override more specific margin styles with "! important". */
|
||||
margin-top: 0 ! important }
|
||||
|
||||
.last, .with-subtitle {
|
||||
margin-bottom: 0 ! important }
|
||||
|
||||
.hidden {
|
||||
display: none }
|
||||
|
||||
.subscript {
|
||||
vertical-align: sub;
|
||||
font-size: smaller }
|
||||
|
||||
.superscript {
|
||||
vertical-align: super;
|
||||
font-size: smaller }
|
||||
|
||||
a.toc-backref {
|
||||
text-decoration: none ;
|
||||
color: black }
|
||||
|
||||
blockquote.epigraph {
|
||||
margin: 2em 5em ; }
|
||||
|
||||
dl.docutils dd {
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Uncomment (and remove this text!) to get bold-faced definition list terms
|
||||
dl.docutils dt {
|
||||
font-weight: bold }
|
||||
*/
|
||||
|
||||
div.abstract {
|
||||
margin: 2em 5em }
|
||||
|
||||
div.abstract p.topic-title {
|
||||
font-weight: bold ;
|
||||
text-align: center }
|
||||
|
||||
div.admonition, div.attention, div.caution, div.danger, div.error,
|
||||
div.hint, div.important, div.note, div.tip, div.warning {
|
||||
margin: 2em ;
|
||||
border: medium outset ;
|
||||
padding: 1em }
|
||||
|
||||
div.admonition p.admonition-title, div.hint p.admonition-title,
|
||||
div.important p.admonition-title, div.note p.admonition-title,
|
||||
div.tip p.admonition-title {
|
||||
font-weight: bold ;
|
||||
font-family: sans-serif }
|
||||
|
||||
div.attention p.admonition-title, div.caution p.admonition-title,
|
||||
div.danger p.admonition-title, div.error p.admonition-title,
|
||||
div.warning p.admonition-title, .code .error {
|
||||
color: red ;
|
||||
font-weight: bold ;
|
||||
font-family: sans-serif }
|
||||
|
||||
/* Uncomment (and remove this text!) to get reduced vertical space in
|
||||
compound paragraphs.
|
||||
div.compound .compound-first, div.compound .compound-middle {
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
div.compound .compound-last, div.compound .compound-middle {
|
||||
margin-top: 0.5em }
|
||||
*/
|
||||
|
||||
div.dedication {
|
||||
margin: 2em 5em ;
|
||||
text-align: center ;
|
||||
font-style: italic }
|
||||
|
||||
div.dedication p.topic-title {
|
||||
font-weight: bold ;
|
||||
font-style: normal }
|
||||
|
||||
div.figure {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
div.footer, div.header {
|
||||
clear: both;
|
||||
font-size: smaller }
|
||||
|
||||
div.line-block {
|
||||
display: block ;
|
||||
margin-top: 1em ;
|
||||
margin-bottom: 1em }
|
||||
|
||||
div.line-block div.line-block {
|
||||
margin-top: 0 ;
|
||||
margin-bottom: 0 ;
|
||||
margin-left: 1.5em }
|
||||
|
||||
div.sidebar {
|
||||
margin: 0 0 0.5em 1em ;
|
||||
border: medium outset ;
|
||||
padding: 1em ;
|
||||
background-color: #ffffee ;
|
||||
width: 40% ;
|
||||
float: right ;
|
||||
clear: right }
|
||||
|
||||
div.sidebar p.rubric {
|
||||
font-family: sans-serif ;
|
||||
font-size: medium }
|
||||
|
||||
div.system-messages {
|
||||
margin: 5em }
|
||||
|
||||
div.system-messages h1 {
|
||||
color: red }
|
||||
|
||||
div.system-message {
|
||||
border: medium outset ;
|
||||
padding: 1em }
|
||||
|
||||
div.system-message p.system-message-title {
|
||||
color: red ;
|
||||
font-weight: bold }
|
||||
|
||||
div.topic {
|
||||
margin: 2em }
|
||||
|
||||
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
|
||||
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
|
||||
margin-top: 0.4em }
|
||||
|
||||
h1.title {
|
||||
text-align: center }
|
||||
|
||||
h2.subtitle {
|
||||
text-align: center }
|
||||
|
||||
hr.docutils {
|
||||
width: 75% }
|
||||
|
||||
img.align-left, .figure.align-left, object.align-left, table.align-left {
|
||||
clear: left ;
|
||||
float: left ;
|
||||
margin-right: 1em }
|
||||
|
||||
img.align-right, .figure.align-right, object.align-right, table.align-right {
|
||||
clear: right ;
|
||||
float: right ;
|
||||
margin-left: 1em }
|
||||
|
||||
img.align-center, .figure.align-center, object.align-center {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
table.align-center {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.align-left {
|
||||
text-align: left }
|
||||
|
||||
.align-center {
|
||||
clear: both ;
|
||||
text-align: center }
|
||||
|
||||
.align-right {
|
||||
text-align: right }
|
||||
|
||||
/* reset inner alignment in figures */
|
||||
div.align-right {
|
||||
text-align: inherit }
|
||||
|
||||
/* div.align-center * { */
|
||||
/* text-align: left } */
|
||||
|
||||
.align-top {
|
||||
vertical-align: top }
|
||||
|
||||
.align-middle {
|
||||
vertical-align: middle }
|
||||
|
||||
.align-bottom {
|
||||
vertical-align: bottom }
|
||||
|
||||
ol.simple, ul.simple {
|
||||
margin-bottom: 1em }
|
||||
|
||||
ol.arabic {
|
||||
list-style: decimal }
|
||||
|
||||
ol.loweralpha {
|
||||
list-style: lower-alpha }
|
||||
|
||||
ol.upperalpha {
|
||||
list-style: upper-alpha }
|
||||
|
||||
ol.lowerroman {
|
||||
list-style: lower-roman }
|
||||
|
||||
ol.upperroman {
|
||||
list-style: upper-roman }
|
||||
|
||||
p.attribution {
|
||||
text-align: right ;
|
||||
margin-left: 50% }
|
||||
|
||||
p.caption {
|
||||
font-style: italic }
|
||||
|
||||
p.credits {
|
||||
font-style: italic ;
|
||||
font-size: smaller }
|
||||
|
||||
p.label {
|
||||
white-space: nowrap }
|
||||
|
||||
p.rubric {
|
||||
font-weight: bold ;
|
||||
font-size: larger ;
|
||||
color: maroon ;
|
||||
text-align: center }
|
||||
|
||||
p.sidebar-title {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold ;
|
||||
font-size: larger }
|
||||
|
||||
p.sidebar-subtitle {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold }
|
||||
|
||||
p.topic-title {
|
||||
font-weight: bold }
|
||||
|
||||
pre.address {
|
||||
margin-bottom: 0 ;
|
||||
margin-top: 0 ;
|
||||
font: inherit }
|
||||
|
||||
pre.literal-block, pre.doctest-block, pre.math, pre.code {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
pre.code .ln { color: grey; } /* line numbers */
|
||||
pre.code, code { background-color: #eeeeee }
|
||||
pre.code .comment, code .comment { color: #5C6576 }
|
||||
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
|
||||
pre.code .literal.string, code .literal.string { color: #0C5404 }
|
||||
pre.code .name.builtin, code .name.builtin { color: #352B84 }
|
||||
pre.code .deleted, code .deleted { background-color: #DEB0A1}
|
||||
pre.code .inserted, code .inserted { background-color: #A3D289}
|
||||
|
||||
span.classifier {
|
||||
font-family: sans-serif ;
|
||||
font-style: oblique }
|
||||
|
||||
span.classifier-delimiter {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold }
|
||||
|
||||
span.interpreted {
|
||||
font-family: sans-serif }
|
||||
|
||||
span.option {
|
||||
white-space: nowrap }
|
||||
|
||||
span.pre {
|
||||
white-space: pre }
|
||||
|
||||
span.problematic {
|
||||
color: red }
|
||||
|
||||
span.section-subtitle {
|
||||
/* font-size relative to parent (h1..h6 element) */
|
||||
font-size: 80% }
|
||||
|
||||
table.citation {
|
||||
border-left: solid 1px gray;
|
||||
margin-left: 1px }
|
||||
|
||||
table.docinfo {
|
||||
margin: 2em 4em }
|
||||
|
||||
table.docutils {
|
||||
margin-top: 0.5em ;
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
table.footnote {
|
||||
border-left: solid 1px black;
|
||||
margin-left: 1px }
|
||||
|
||||
table.docutils td, table.docutils th,
|
||||
table.docinfo td, table.docinfo th {
|
||||
padding-left: 0.5em ;
|
||||
padding-right: 0.5em ;
|
||||
vertical-align: top }
|
||||
|
||||
table.docutils th.field-name, table.docinfo th.docinfo-name {
|
||||
font-weight: bold ;
|
||||
text-align: left ;
|
||||
white-space: nowrap ;
|
||||
padding-left: 0 }
|
||||
|
||||
/* "booktabs" style (no vertical lines) */
|
||||
table.docutils.booktabs {
|
||||
border: 0px;
|
||||
border-top: 2px solid;
|
||||
border-bottom: 2px solid;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
table.docutils.booktabs * {
|
||||
border: 0px;
|
||||
}
|
||||
table.docutils.booktabs th {
|
||||
border-bottom: thin solid;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
|
||||
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
|
||||
font-size: 100% }
|
||||
|
||||
ul.auto-toc {
|
||||
list-style-type: none }
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="document" id="procurement-auto-create-group">
|
||||
<h1 class="title">Procurement Auto Create Group</h1>
|
||||
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/tree/13.0/procurement_auto_create_group"><img alt="OCA/stock-logistics-warehouse" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/stock-logistics-warehouse-13-0/stock-logistics-warehouse-13-0-procurement_auto_create_group"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/153/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
|
||||
<p>This module allows the system to propose automatically new procurement groups
|
||||
during the procurement run.</p>
|
||||
<p>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.</p>
|
||||
<p>The stock transfers resulting from the procurement run will
|
||||
only contain stock moves created in that run.</p>
|
||||
<p><strong>Table of contents</strong></p>
|
||||
<div class="contents local topic" id="contents">
|
||||
<ul class="simple">
|
||||
<li><a class="reference internal" href="#configuration" id="id1">Configuration</a></li>
|
||||
<li><a class="reference internal" href="#usage" id="id2">Usage</a></li>
|
||||
<li><a class="reference internal" href="#bug-tracker" id="id3">Bug Tracker</a></li>
|
||||
<li><a class="reference internal" href="#credits" id="id4">Credits</a><ul>
|
||||
<li><a class="reference internal" href="#authors" id="id5">Authors</a></li>
|
||||
<li><a class="reference internal" href="#contributors" id="id6">Contributors</a></li>
|
||||
<li><a class="reference internal" href="#maintainers" id="id7">Maintainers</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="configuration">
|
||||
<h1><a class="toc-backref" href="#id1">Configuration</a></h1>
|
||||
<ol class="arabic simple">
|
||||
<li>Go to <em>Inventory / Configuration / Settings</em> and check the option
|
||||
‘Multi-Step Routes’ and press the ‘Save’ button.</li>
|
||||
<li>Activate the developer mode.</li>
|
||||
<li>Go to <em>Inventory / Configuration / Warehouse Management / Routes</em>
|
||||
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.</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="section" id="usage">
|
||||
<h1><a class="toc-backref" href="#id2">Usage</a></h1>
|
||||
<ol class="arabic simple">
|
||||
<li>Run a new procurement and make sure that it determines a pull rule
|
||||
with the option ‘Auto-create Procurement Group’ set.</li>
|
||||
<li>When the procurement rule is executed, a procurement group with
|
||||
format ‘PG/000001’ will be created.</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="section" id="bug-tracker">
|
||||
<h1><a class="toc-backref" href="#id3">Bug Tracker</a></h1>
|
||||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/issues">GitHub Issues</a>.
|
||||
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
|
||||
<a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20procurement_auto_create_group%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
||||
</div>
|
||||
<div class="section" id="credits">
|
||||
<h1><a class="toc-backref" href="#id4">Credits</a></h1>
|
||||
<div class="section" id="authors">
|
||||
<h2><a class="toc-backref" href="#id5">Authors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>ForgeFlow</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="contributors">
|
||||
<h2><a class="toc-backref" href="#id6">Contributors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Jordi Ballester <<a class="reference external" href="mailto:jordi.ballester@forgeflow.com">jordi.ballester@forgeflow.com</a>></li>
|
||||
<li>Lois Rilo <<a class="reference external" href="mailto:lois.rilo@forgeflow.com">lois.rilo@forgeflow.com</a>></li>
|
||||
<li>Héctor Villarreal Ortega <<a class="reference external" href="mailto:hector.villarreal@forgeflow.com">hector.villarreal@forgeflow.com</a>></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
<h2><a class="toc-backref" href="#id7">Maintainers</a></h2>
|
||||
<p>This module is maintained by the OCA.</p>
|
||||
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
|
||||
<p>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.</p>
|
||||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/tree/13.0/procurement_auto_create_group">OCA/stock-logistics-warehouse</a> project on GitHub.</p>
|
||||
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
3
procurement_auto_create_group/tests/__init__.py
Normal file
3
procurement_auto_create_group/tests/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from . import test_auto_create
|
||||
108
procurement_auto_create_group/tests/test_auto_create.py
Normal file
108
procurement_auto_create_group/tests/test_auto_create.py
Normal file
@@ -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)
|
||||
16
procurement_auto_create_group/views/procurement_view.xml
Normal file
16
procurement_auto_create_group/views/procurement_view.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
<record model="ir.ui.view" id="view_stock_rule_form">
|
||||
<field name="name">stock.rule.form - procurement_auto_create_group</field>
|
||||
<field name="model">stock.rule</field>
|
||||
<field name="inherit_id" ref="stock.view_stock_rule_form" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="group_propagation_option" position="after">
|
||||
<field
|
||||
name="auto_create_group"
|
||||
attrs="{'invisible':[('group_propagation_option','!=','propagate')]}"
|
||||
/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user