diff --git a/setup/stock_available_immediately/odoo/addons/stock_available_immediately b/setup/stock_available_immediately/odoo/addons/stock_available_immediately new file mode 120000 index 000000000000..8ab3a1f1986a --- /dev/null +++ b/setup/stock_available_immediately/odoo/addons/stock_available_immediately @@ -0,0 +1 @@ +../../../../stock_available_immediately \ No newline at end of file diff --git a/setup/stock_available_immediately/setup.py b/setup/stock_available_immediately/setup.py new file mode 100644 index 000000000000..28c57bb64031 --- /dev/null +++ b/setup/stock_available_immediately/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/stock_available/models/res_config_settings.py b/stock_available/models/res_config_settings.py index 41242a4c0f32..cfaa6bbd9d77 100644 --- a/stock_available/models/res_config_settings.py +++ b/stock_available/models/res_config_settings.py @@ -13,8 +13,10 @@ class ResConfigSettings(models.TransientModel): @api.model def _get_stock_available_mrp_based_on(self): """Gets the available languages for the selection.""" - pdct_fields = self.env["ir.model.fields"].search( - [("model", "=", "product.product"), ("ttype", "=", "float")] + pdct_fields = ( + self.env["ir.model.fields"] + .sudo() + .search([("model", "=", "product.product"), ("ttype", "=", "float")]) ) return [ (field.name, field.field_description) diff --git a/stock_available_immediately/README.rst b/stock_available_immediately/README.rst new file mode 100644 index 000000000000..4344c2af0653 --- /dev/null +++ b/stock_available_immediately/README.rst @@ -0,0 +1,87 @@ +========================================================== +Ignore planned receptions in quantity available to promise +========================================================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github + :target: https://github.com/OCA/stock-logistics-warehouse/tree/14.0/stock_available_immediately + :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-14-0/stock-logistics-warehouse-14-0-stock_available_immediately + :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/14.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Normally the quantity available to promise is based on the virtual stock, +which includes both planned outgoing and incoming goods. +This module will subtract the planned receptions from the quantity available to +promise. + +**Table of contents** + +.. contents:: + :local: + +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 +~~~~~~~ + +* Camptocamp +* Sodexis +* Sergio Díaz + +Contributors +~~~~~~~~~~~~ + +* Author: Guewen Baconnier (Camptocamp SA) +* Sébastien BEAU (Akretion) +* Lionel Sausin (Numérigraphe) +* Sodexis +* Cédric Pigeon +* Sergio Díaz +* `Tecnativa `_: + + * Pedro M. Baeza +* Florian da Costa + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/stock-logistics-warehouse `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/stock_available_immediately/__init__.py b/stock_available_immediately/__init__.py new file mode 100644 index 000000000000..83e553ac462c --- /dev/null +++ b/stock_available_immediately/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import models diff --git a/stock_available_immediately/__manifest__.py b/stock_available_immediately/__manifest__.py new file mode 100644 index 000000000000..a896c2b03dae --- /dev/null +++ b/stock_available_immediately/__manifest__.py @@ -0,0 +1,16 @@ +# Copyright 2014 Camptocamp, Akretion, Numérigraphe +# Copyright 2016 Sodexis +# Copyright 2019 Sergio Díaz +# Copyright 2020 Tecnativa - Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + "name": "Ignore planned receptions in quantity available to promise", + "version": "15.0.1.0.0", + "depends": ["stock_available"], + "website": "https://github.com/OCA/stock-logistics-warehouse", + "author": "Camptocamp,Sodexis,Odoo Community Association (OCA),Sergio Díaz", + "license": "AGPL-3", + "category": "Hidden", + "installable": True, +} diff --git a/stock_available_immediately/i18n/ca.po b/stock_available_immediately/i18n/ca.po new file mode 100644 index 000000000000..11cbdd34ac11 --- /dev/null +++ b/stock_available_immediately/i18n/ca.po @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-16 14:35+0000\n" +"PO-Revision-Date: 2018-01-16 14:35+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Catalan (https://www.transifex.com/oca/teams/23907/ca/)\n" +"Language: ca\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: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Producte" diff --git a/stock_available_immediately/i18n/cs_CZ.po b/stock_available_immediately/i18n/cs_CZ.po new file mode 100644 index 000000000000..2150a116f621 --- /dev/null +++ b/stock_available_immediately/i18n/cs_CZ.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# 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: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Produkt" diff --git a/stock_available_immediately/i18n/de.po b/stock_available_immediately/i18n/de.po new file mode 100644 index 000000000000..1b9f9e29cc88 --- /dev/null +++ b/stock_available_immediately/i18n/de.po @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-16 14:35+0000\n" +"PO-Revision-Date: 2018-01-16 14:35+0000\n" +"Last-Translator: OCA Transbot , 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: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Produkt" diff --git a/stock_available_immediately/i18n/el_GR.po b/stock_available_immediately/i18n/el_GR.po new file mode 100644 index 000000000000..fba06d96ce6d --- /dev/null +++ b/stock_available_immediately/i18n/el_GR.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-03 01:23+0000\n" +"PO-Revision-Date: 2017-06-03 01:23+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Greek (Greece) (https://www.transifex.com/oca/teams/23907/" +"el_GR/)\n" +"Language: el_GR\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: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Προϊόν" diff --git a/stock_available_immediately/i18n/es.po b/stock_available_immediately/i18n/es.po new file mode 100644 index 000000000000..92c181447039 --- /dev/null +++ b/stock_available_immediately/i18n/es.po @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-16 14:35+0000\n" +"PO-Revision-Date: 2018-01-16 14:35+0000\n" +"Last-Translator: OCA Transbot , 2017\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: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Producto" diff --git a/stock_available_immediately/i18n/es_ES.po b/stock_available_immediately/i18n/es_ES.po new file mode 100644 index 000000000000..4595b90f55ec --- /dev/null +++ b/stock_available_immediately/i18n/es_ES.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-03 01:23+0000\n" +"PO-Revision-Date: 2017-06-03 01:23+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Spanish (Spain) (https://www.transifex.com/oca/teams/23907/" +"es_ES/)\n" +"Language: es_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: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Producto" diff --git a/stock_available_immediately/i18n/es_MX.po b/stock_available_immediately/i18n/es_MX.po new file mode 100644 index 000000000000..e2c5f9ff8935 --- /dev/null +++ b/stock_available_immediately/i18n/es_MX.po @@ -0,0 +1,28 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-03 01:23+0000\n" +"PO-Revision-Date: 2017-06-03 01:23+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: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "" + +#~ msgid "Product Template" +#~ msgstr "Plantilla del producto" diff --git a/stock_available_immediately/i18n/eu.po b/stock_available_immediately/i18n/eu.po new file mode 100644 index 000000000000..1e696cd1de52 --- /dev/null +++ b/stock_available_immediately/i18n/eu.po @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-03 01:23+0000\n" +"PO-Revision-Date: 2017-06-03 01:23+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Basque (https://www.transifex.com/oca/teams/23907/eu/)\n" +"Language: eu\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: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Produktua" diff --git a/stock_available_immediately/i18n/fi.po b/stock_available_immediately/i18n/fi.po new file mode 100644 index 000000000000..6c5f4e970b94 --- /dev/null +++ b/stock_available_immediately/i18n/fi.po @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-16 14:35+0000\n" +"PO-Revision-Date: 2018-01-16 14:35+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Finnish (https://www.transifex.com/oca/teams/23907/fi/)\n" +"Language: fi\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: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Tuote" diff --git a/stock_available_immediately/i18n/fr.po b/stock_available_immediately/i18n/fr.po new file mode 100644 index 000000000000..346d567f37ec --- /dev/null +++ b/stock_available_immediately/i18n/fr.po @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-16 14:35+0000\n" +"PO-Revision-Date: 2018-01-16 14:35+0000\n" +"Last-Translator: OCA Transbot , 2017\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" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Article" diff --git a/stock_available_immediately/i18n/fr_CH.po b/stock_available_immediately/i18n/fr_CH.po new file mode 100644 index 000000000000..5b3ea4eb52f3 --- /dev/null +++ b/stock_available_immediately/i18n/fr_CH.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-16 14:35+0000\n" +"PO-Revision-Date: 2018-01-16 14:35+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: French (Switzerland) (https://www.transifex.com/oca/" +"teams/23907/fr_CH/)\n" +"Language: fr_CH\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: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Produit" diff --git a/stock_available_immediately/i18n/fr_FR.po b/stock_available_immediately/i18n/fr_FR.po new file mode 100644 index 000000000000..b45424fdb58a --- /dev/null +++ b/stock_available_immediately/i18n/fr_FR.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-03 01:23+0000\n" +"PO-Revision-Date: 2017-06-03 01:23+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: French (France) (https://www.transifex.com/oca/teams/23907/" +"fr_FR/)\n" +"Language: fr_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" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Produit" diff --git a/stock_available_immediately/i18n/gl.po b/stock_available_immediately/i18n/gl.po new file mode 100644 index 000000000000..748a5aa9e8fd --- /dev/null +++ b/stock_available_immediately/i18n/gl.po @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-03 01:23+0000\n" +"PO-Revision-Date: 2017-06-03 01:23+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Galician (https://www.transifex.com/oca/teams/23907/gl/)\n" +"Language: gl\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: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Produto" diff --git a/stock_available_immediately/i18n/hr.po b/stock_available_immediately/i18n/hr.po new file mode 100644 index 000000000000..48707b334ea9 --- /dev/null +++ b/stock_available_immediately/i18n/hr.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-16 14:35+0000\n" +"PO-Revision-Date: 2018-01-16 14:35+0000\n" +"Last-Translator: OCA Transbot , 2017\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: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Proizvod" diff --git a/stock_available_immediately/i18n/hr_HR.po b/stock_available_immediately/i18n/hr_HR.po new file mode 100644 index 000000000000..761931224a27 --- /dev/null +++ b/stock_available_immediately/i18n/hr_HR.po @@ -0,0 +1,26 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-16 14:35+0000\n" +"PO-Revision-Date: 2018-01-16 14:35+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Croatian (Croatia) (https://www.transifex.com/oca/teams/23907/" +"hr_HR/)\n" +"Language: hr_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: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Proizvod" diff --git a/stock_available_immediately/i18n/it.po b/stock_available_immediately/i18n/it.po new file mode 100644 index 000000000000..7d371ca6d01f --- /dev/null +++ b/stock_available_immediately/i18n/it.po @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-16 14:35+0000\n" +"PO-Revision-Date: 2018-01-16 14:35+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: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Prodotto" diff --git a/stock_available_immediately/i18n/nl.po b/stock_available_immediately/i18n/nl.po new file mode 100644 index 000000000000..7069a746d082 --- /dev/null +++ b/stock_available_immediately/i18n/nl.po @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-03 01:23+0000\n" +"PO-Revision-Date: 2017-06-03 01:23+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Dutch (https://www.transifex.com/oca/teams/23907/nl/)\n" +"Language: nl\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: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Product" diff --git a/stock_available_immediately/i18n/nl_NL.po b/stock_available_immediately/i18n/nl_NL.po new file mode 100644 index 000000000000..1b6deae0f61a --- /dev/null +++ b/stock_available_immediately/i18n/nl_NL.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-16 14:35+0000\n" +"PO-Revision-Date: 2018-01-16 14:35+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/" +"teams/23907/nl_NL/)\n" +"Language: nl_NL\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: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Product" diff --git a/stock_available_immediately/i18n/pt.po b/stock_available_immediately/i18n/pt.po new file mode 100644 index 000000000000..84a55d679a3e --- /dev/null +++ b/stock_available_immediately/i18n/pt.po @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-06-03 01:23+0000\n" +"PO-Revision-Date: 2017-06-03 01:23+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Portuguese (https://www.transifex.com/oca/teams/23907/pt/)\n" +"Language: 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: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Produto" diff --git a/stock_available_immediately/i18n/pt_BR.po b/stock_available_immediately/i18n/pt_BR.po new file mode 100644 index 000000000000..0a83f914581f --- /dev/null +++ b/stock_available_immediately/i18n/pt_BR.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-16 14:35+0000\n" +"PO-Revision-Date: 2018-01-16 14:35+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: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Produto" diff --git a/stock_available_immediately/i18n/ro.po b/stock_available_immediately/i18n/ro.po new file mode 100644 index 000000000000..d51379315829 --- /dev/null +++ b/stock_available_immediately/i18n/ro.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-16 14:35+0000\n" +"PO-Revision-Date: 2018-01-16 14:35+0000\n" +"Last-Translator: OCA Transbot , 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: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Produs" diff --git a/stock_available_immediately/i18n/ru.po b/stock_available_immediately/i18n/ru.po new file mode 100644 index 000000000000..b684c031d277 --- /dev/null +++ b/stock_available_immediately/i18n/ru.po @@ -0,0 +1,26 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-16 14:35+0000\n" +"PO-Revision-Date: 2018-01-16 14:35+0000\n" +"Last-Translator: OCA Transbot , 2018\n" +"Language-Team: Russian (https://www.transifex.com/oca/teams/23907/ru/)\n" +"Language: ru\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n" +"%100>=11 && n%100<=14)? 2 : 3);\n" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Товар/Услуга" diff --git a/stock_available_immediately/i18n/sl.po b/stock_available_immediately/i18n/sl.po new file mode 100644 index 000000000000..e4404449da44 --- /dev/null +++ b/stock_available_immediately/i18n/sl.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-16 14:35+0000\n" +"PO-Revision-Date: 2018-01-16 14:35+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: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Proizvod" diff --git a/stock_available_immediately/i18n/stock_available_immediately.pot b/stock_available_immediately/i18n/stock_available_immediately.pot new file mode 100644 index 000000000000..ff27aa48bef6 --- /dev/null +++ b/stock_available_immediately/i18n/stock_available_immediately.pot @@ -0,0 +1,34 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.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: stock_available_immediately +#: model:ir.model.fields,field_description:stock_available_immediately.field_product_product__display_name +msgid "Display Name" +msgstr "" + +#. module: stock_available_immediately +#: model:ir.model.fields,field_description:stock_available_immediately.field_product_product__id +msgid "ID" +msgstr "" + +#. module: stock_available_immediately +#: model:ir.model.fields,field_description:stock_available_immediately.field_product_product____last_update +msgid "Last Modified on" +msgstr "" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "" diff --git a/stock_available_immediately/i18n/tr.po b/stock_available_immediately/i18n/tr.po new file mode 100644 index 000000000000..61375ee76a4e --- /dev/null +++ b/stock_available_immediately/i18n/tr.po @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-16 14:35+0000\n" +"PO-Revision-Date: 2018-01-16 14:35+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Turkish (https://www.transifex.com/oca/teams/23907/tr/)\n" +"Language: tr\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: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Ürün" diff --git a/stock_available_immediately/i18n/tr_TR.po b/stock_available_immediately/i18n/tr_TR.po new file mode 100644 index 000000000000..6beabb80f9b8 --- /dev/null +++ b/stock_available_immediately/i18n/tr_TR.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-16 14:35+0000\n" +"PO-Revision-Date: 2018-01-16 14:35+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: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Ürün" diff --git a/stock_available_immediately/i18n/vi_VN.po b/stock_available_immediately/i18n/vi_VN.po new file mode 100644 index 000000000000..a9217cd9764e --- /dev/null +++ b/stock_available_immediately/i18n/vi_VN.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-16 14:35+0000\n" +"PO-Revision-Date: 2018-01-16 14:35+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: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "Sản phẩm" diff --git a/stock_available_immediately/i18n/zh_CN.po b/stock_available_immediately/i18n/zh_CN.po new file mode 100644 index 000000000000..15df1d1e953c --- /dev/null +++ b/stock_available_immediately/i18n/zh_CN.po @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_available_immediately +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-01-16 14:35+0000\n" +"PO-Revision-Date: 2018-01-16 14:35+0000\n" +"Last-Translator: OCA Transbot , 2017\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" + +#. module: stock_available_immediately +#: model:ir.model,name:stock_available_immediately.model_product_product +msgid "Product" +msgstr "产品" diff --git a/stock_available_immediately/models/__init__.py b/stock_available_immediately/models/__init__.py new file mode 100644 index 000000000000..586a7eff4ecf --- /dev/null +++ b/stock_available_immediately/models/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import product_product diff --git a/stock_available_immediately/models/product_product.py b/stock_available_immediately/models/product_product.py new file mode 100644 index 000000000000..b82dc7da9b17 --- /dev/null +++ b/stock_available_immediately/models/product_product.py @@ -0,0 +1,27 @@ +# Copyright 2014 Camptocamp, Akretion, Numérigraphe +# Copyright 2016 Sodexis +# Copyright 2019 Sergio Díaz +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import api, models +from odoo.tools import config + + +class ProductProduct(models.Model): + _inherit = "product.product" + + def _compute_available_quantities_dict(self): + res, stock_dict = super()._compute_available_quantities_dict() + if config["test_enable"] and not self.env.context.get( + "test_stock_available_immediately" + ): + return res, stock_dict + for product in self: + res[product.id]["immediately_usable_qty"] -= stock_dict[product.id][ + "incoming_qty" + ] + return res, stock_dict + + @api.depends("virtual_available", "incoming_qty") + def _compute_available_quantities(self): + return super()._compute_available_quantities() diff --git a/stock_available_immediately/readme/CONTRIBUTORS.rst b/stock_available_immediately/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000000..efc2cf7f507f --- /dev/null +++ b/stock_available_immediately/readme/CONTRIBUTORS.rst @@ -0,0 +1,10 @@ +* Author: Guewen Baconnier (Camptocamp SA) +* Sébastien BEAU (Akretion) +* Lionel Sausin (Numérigraphe) +* Sodexis +* Cédric Pigeon +* Sergio Díaz +* `Tecnativa `_: + + * Pedro M. Baeza +* Florian da Costa diff --git a/stock_available_immediately/readme/DESCRIPTION.rst b/stock_available_immediately/readme/DESCRIPTION.rst new file mode 100644 index 000000000000..920e88bb4bef --- /dev/null +++ b/stock_available_immediately/readme/DESCRIPTION.rst @@ -0,0 +1,4 @@ +Normally the quantity available to promise is based on the virtual stock, +which includes both planned outgoing and incoming goods. +This module will subtract the planned receptions from the quantity available to +promise. diff --git a/stock_available_immediately/static/description/icon.png b/stock_available_immediately/static/description/icon.png new file mode 100644 index 000000000000..3a0328b516c4 Binary files /dev/null and b/stock_available_immediately/static/description/icon.png differ diff --git a/stock_available_immediately/static/description/index.html b/stock_available_immediately/static/description/index.html new file mode 100644 index 000000000000..4845a543808c --- /dev/null +++ b/stock_available_immediately/static/description/index.html @@ -0,0 +1,434 @@ + + + + + + +Ignore planned receptions in quantity available to promise + + + +
+

Ignore planned receptions in quantity available to promise

+ + +

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

+

Normally the quantity available to promise is based on the virtual stock, +which includes both planned outgoing and incoming goods. +This module will subtract the planned receptions from the quantity available to +promise.

+

Table of contents

+ +
+

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

+
    +
  • Camptocamp
  • +
  • Sodexis
  • +
  • Sergio Díaz
  • +
+
+
+

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/stock_available_immediately/tests/__init__.py b/stock_available_immediately/tests/__init__.py new file mode 100644 index 000000000000..84148ecdeaf4 --- /dev/null +++ b/stock_available_immediately/tests/__init__.py @@ -0,0 +1 @@ +from . import test_stock_available_immediately diff --git a/stock_available_immediately/tests/test_stock_available_immediately.py b/stock_available_immediately/tests/test_stock_available_immediately.py new file mode 100644 index 000000000000..7cfee7c47ca1 --- /dev/null +++ b/stock_available_immediately/tests/test_stock_available_immediately.py @@ -0,0 +1,125 @@ +# Copyright 2014 Camptocamp, Akretion, Numérigraphe +# Copyright 2016 Sodexis +# Copyright 2019 Sergio Díaz +# Copyright 2020 Tecnativa - Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo.tests.common import TransactionCase + + +class TestStockLogisticsWarehouse(TransactionCase): + def test01_stock_levels(self): + """ + Checking that immediately_usable_qty actually reflects the variations + in stock, both on product and template. + """ + moveObj = self.env["stock.move"] + templateObj = self.env["product.template"] + supplier_location = self.env.ref("stock.stock_location_suppliers") + stock_location = self.env.ref("stock.stock_location_stock") + customer_location = self.env.ref("stock.stock_location_customers") + uom_unit = self.env.ref("uom.product_uom_unit") + + # Create product template with 2 variant + templateAB = templateObj.create( + {"name": "templAB", "uom_id": uom_unit.id, "type": "product"} + ) + templateAB = templateAB.with_context(test_stock_available_immediately=True) + self.env["product.template.attribute.line"].create( + { + "product_tmpl_id": templateAB.id, + "attribute_id": self.env.ref("product.product_attribute_2").id, + "value_ids": [ + ( + 6, + 0, + [ + self.env.ref("product.product_attribute_value_3").id, + self.env.ref("product.product_attribute_value_4").id, + ], + ) + ], + } + ) + + # Create product A and B + productA = templateAB.product_variant_ids[0] + productB = templateAB.product_variant_ids[1] + + # Create a stock move from INCOMING to STOCK + stockMoveInA = moveObj.create( + { + "location_id": supplier_location.id, + "location_dest_id": stock_location.id, + "name": "MOVE INCOMING -> STOCK ", + "product_id": productA.id, + "product_uom": productA.uom_id.id, + "product_uom_qty": 2, + } + ) + + stockMoveInB = moveObj.create( + { + "location_id": supplier_location.id, + "location_dest_id": stock_location.id, + "name": "MOVE INCOMING -> STOCK ", + "product_id": productB.id, + "product_uom": productB.uom_id.id, + "product_uom_qty": 3, + } + ) + + def compare_product_usable_qty(product, value): + # Refresh, because the function field is not recalculated between + # transactions + product.refresh() + self.assertEqual(product.immediately_usable_qty, value) + + compare_product_usable_qty(productA, 0) + compare_product_usable_qty(templateAB, 0) + + stockMoveInA._action_confirm() + compare_product_usable_qty(productA, 0) + compare_product_usable_qty(templateAB, 0) + + stockMoveInA._action_assign() + compare_product_usable_qty(productA, 0) + compare_product_usable_qty(templateAB, 0) + + stockMoveInA.move_line_ids.write({"qty_done": 2.0}) + stockMoveInA._action_done() + compare_product_usable_qty(productA, 2) + compare_product_usable_qty(templateAB, 2) + + # will directly trigger action_done on productB + stockMoveInB._action_confirm() + stockMoveInB._action_assign() + stockMoveInB.move_line_ids.write({"qty_done": 3.0}) + stockMoveInB._action_done() + compare_product_usable_qty(productA, 2) + compare_product_usable_qty(productB, 3) + compare_product_usable_qty(templateAB, 5) + + # Create a stock move from STOCK to CUSTOMER + stockMoveOutA = moveObj.create( + { + "location_id": stock_location.id, + "location_dest_id": customer_location.id, + "name": " STOCK --> CUSTOMER ", + "product_id": productA.id, + "product_uom": productA.uom_id.id, + "product_uom_qty": 1, + "state": "confirmed", + } + ) + + stockMoveOutA._action_confirm() + stockMoveOutA._action_assign() + stockMoveOutA.move_line_ids.write({"qty_done": 1.0}) + stockMoveOutA._action_done() + compare_product_usable_qty(productA, 1) + compare_product_usable_qty(templateAB, 4) + + # Potential Qty is set as 0.0 by default + self.assertEqual(templateAB.potential_qty, 0.0) + self.assertEqual(productA.potential_qty, 0.0)