[11.0][MIG] port stock_available_mrp to 11.0

This commit is contained in:
Timon Tschanz
2019-01-04 13:03:03 +01:00
committed by Florian da Costa
parent 85883c4ab0
commit e6a9e9bf43
19 changed files with 352 additions and 200 deletions

View File

@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*- # Copyright 2014 Numérigraphe SARL
# © 2014 Numérigraphe SARL
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import models from . import models

View File

@@ -1,11 +1,11 @@
# -*- coding: utf-8 -*- # Copyright 2014 Numérigraphe SARL, Camptocamp
# © 2014 Numérigraphe SARL, Camptocamp
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{ {
'name': 'Consider the production potential is available to promise', 'name': 'Consider the production potential is available to promise',
'version': '10.0.1.0.0', 'version': '11.0.1.0.0',
"author": u"Numérigraphe," "author": "Numérigraphe,"
u"Odoo Community Association (OCA)", "Odoo Community Association (OCA)",
'website': 'https://github.com/OCA/stock-logistics-warehouse',
'category': 'Hidden', 'category': 'Hidden',
'depends': [ 'depends': [
'stock_available', 'stock_available',

View File

@@ -21,7 +21,7 @@
<field name="categ_id" ref="product.product_category_5"/> <field name="categ_id" ref="product.product_category_5"/>
<field name="standard_price">10.0</field> <field name="standard_price">10.0</field>
<field name="list_price">47.0</field> <field name="list_price">47.0</field>
<field name="type">consu</field> <field name="type">product</field>
<field name="uom_id" ref="product.product_uom_unit"/> <field name="uom_id" ref="product.product_uom_unit"/>
<field name="uom_po_id" ref="product.product_uom_unit"/> <field name="uom_po_id" ref="product.product_uom_unit"/>
<field name="default_code">E-COM10-WHITE</field> <field name="default_code">E-COM10-WHITE</field>

View File

@@ -1,7 +1,7 @@
# Translation of Odoo Server. # Translation of Odoo Server.
# This file contains the translation of the following modules: # This file contains the translation of the following modules:
# * stock_available_mrp # * stock_available_mrp
# #
# Translators: # Translators:
# Rudolf Schnapka <rs@techno-flex.de>, 2016 # Rudolf Schnapka <rs@techno-flex.de>, 2016
msgid "" msgid ""
@@ -11,13 +11,25 @@ msgstr ""
"POT-Creation-Date: 2016-01-14 01:38+0000\n" "POT-Creation-Date: 2016-01-14 01:38+0000\n"
"PO-Revision-Date: 2016-01-14 09:35+0000\n" "PO-Revision-Date: 2016-01-14 09:35+0000\n"
"Last-Translator: Rudolf Schnapka <rs@techno-flex.de>\n" "Last-Translator: Rudolf Schnapka <rs@techno-flex.de>\n"
"Language-Team: German (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-8-0/language/de/)\n" "Language-Team: German (http://www.transifex.com/oca/OCA-stock-logistics-"
"warehouse-8-0/language/de/)\n"
"Language: de\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n" "Content-Transfer-Encoding: \n"
"Language: de\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: stock_available_mrp
#: model:product.product,name:stock_available_mrp.product_product_9_white
#: model:product.template,name:stock_available_mrp.product_product_9_white_product_template
msgid "Apple Wireless Keyboard"
msgstr ""
#. module: stock_available_mrp
#: model:ir.model.fields,field_description:stock_available_mrp.field_product_product_bom_id
msgid "Bill of Materials"
msgstr ""
#. module: stock_available_mrp #. module: stock_available_mrp
#: model:ir.model,name:stock_available_mrp.model_product_product #: model:ir.model,name:stock_available_mrp.model_product_product
msgid "Product" msgid "Product"
@@ -29,6 +41,16 @@ msgid "Product Template"
msgstr "Produktvorlage" msgstr "Produktvorlage"
#. module: stock_available_mrp #. module: stock_available_mrp
#: model:product.uom,name:stock_available_mrp.thousand #: model:product.product,name:stock_available_mrp.product_kit_1a
msgid "Thousand" #: model:product.template,name:stock_available_mrp.product_kit_1a_product_template
msgstr "Tausend" msgid "Self Build Kit"
msgstr ""
#. module: stock_available_mrp
#: model:product.product,description:stock_available_mrp.product_kit_1a
#: model:product.template,description:stock_available_mrp.product_kit_1a_product_template
msgid "Self Build kit."
msgstr ""
#~ msgid "Thousand"
#~ msgstr "Tausend"

View File

@@ -1,7 +1,7 @@
# Translation of Odoo Server. # Translation of Odoo Server.
# This file contains the translation of the following modules: # This file contains the translation of the following modules:
# * stock_available_mrp # * stock_available_mrp
# #
# Translators: # Translators:
msgid "" msgid ""
msgstr "" msgstr ""
@@ -10,13 +10,25 @@ msgstr ""
"POT-Creation-Date: 2016-01-14 01:38+0000\n" "POT-Creation-Date: 2016-01-14 01:38+0000\n"
"PO-Revision-Date: 2016-01-13 16:35+0000\n" "PO-Revision-Date: 2016-01-13 16:35+0000\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: Spanish (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-8-0/language/es/)\n" "Language-Team: Spanish (http://www.transifex.com/oca/OCA-stock-logistics-"
"warehouse-8-0/language/es/)\n"
"Language: es\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n" "Content-Transfer-Encoding: \n"
"Language: es\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: stock_available_mrp
#: model:product.product,name:stock_available_mrp.product_product_9_white
#: model:product.template,name:stock_available_mrp.product_product_9_white_product_template
msgid "Apple Wireless Keyboard"
msgstr ""
#. module: stock_available_mrp
#: model:ir.model.fields,field_description:stock_available_mrp.field_product_product_bom_id
msgid "Bill of Materials"
msgstr ""
#. module: stock_available_mrp #. module: stock_available_mrp
#: model:ir.model,name:stock_available_mrp.model_product_product #: model:ir.model,name:stock_available_mrp.model_product_product
msgid "Product" msgid "Product"
@@ -28,6 +40,13 @@ msgid "Product Template"
msgstr "Plantilla de producto" msgstr "Plantilla de producto"
#. module: stock_available_mrp #. module: stock_available_mrp
#: model:product.uom,name:stock_available_mrp.thousand #: model:product.product,name:stock_available_mrp.product_kit_1a
msgid "Thousand" #: model:product.template,name:stock_available_mrp.product_kit_1a_product_template
msgid "Self Build Kit"
msgstr ""
#. module: stock_available_mrp
#: model:product.product,description:stock_available_mrp.product_kit_1a
#: model:product.template,description:stock_available_mrp.product_kit_1a_product_template
msgid "Self Build kit."
msgstr "" msgstr ""

View File

@@ -1,7 +1,7 @@
# Translation of Odoo Server. # Translation of Odoo Server.
# This file contains the translation of the following modules: # This file contains the translation of the following modules:
# * stock_available_mrp # * stock_available_mrp
# #
# Translators: # Translators:
msgid "" msgid ""
msgstr "" msgstr ""
@@ -10,13 +10,25 @@ msgstr ""
"POT-Creation-Date: 2016-01-14 01:38+0000\n" "POT-Creation-Date: 2016-01-14 01:38+0000\n"
"PO-Revision-Date: 2016-01-13 16:35+0000\n" "PO-Revision-Date: 2016-01-13 16:35+0000\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: Finnish (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-8-0/language/fi/)\n" "Language-Team: Finnish (http://www.transifex.com/oca/OCA-stock-logistics-"
"warehouse-8-0/language/fi/)\n"
"Language: fi\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n" "Content-Transfer-Encoding: \n"
"Language: fi\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: stock_available_mrp
#: model:product.product,name:stock_available_mrp.product_product_9_white
#: model:product.template,name:stock_available_mrp.product_product_9_white_product_template
msgid "Apple Wireless Keyboard"
msgstr ""
#. module: stock_available_mrp
#: model:ir.model.fields,field_description:stock_available_mrp.field_product_product_bom_id
msgid "Bill of Materials"
msgstr ""
#. module: stock_available_mrp #. module: stock_available_mrp
#: model:ir.model,name:stock_available_mrp.model_product_product #: model:ir.model,name:stock_available_mrp.model_product_product
msgid "Product" msgid "Product"
@@ -28,6 +40,13 @@ msgid "Product Template"
msgstr "Tuotteen malli" msgstr "Tuotteen malli"
#. module: stock_available_mrp #. module: stock_available_mrp
#: model:product.uom,name:stock_available_mrp.thousand #: model:product.product,name:stock_available_mrp.product_kit_1a
msgid "Thousand" #: model:product.template,name:stock_available_mrp.product_kit_1a_product_template
msgid "Self Build Kit"
msgstr ""
#. module: stock_available_mrp
#: model:product.product,description:stock_available_mrp.product_kit_1a
#: model:product.template,description:stock_available_mrp.product_kit_1a_product_template
msgid "Self Build kit."
msgstr "" msgstr ""

View File

@@ -1,7 +1,7 @@
# Translation of Odoo Server. # Translation of Odoo Server.
# This file contains the translation of the following modules: # This file contains the translation of the following modules:
# * stock_available_mrp # * stock_available_mrp
# #
# Translators: # Translators:
msgid "" msgid ""
msgstr "" msgstr ""
@@ -10,13 +10,25 @@ msgstr ""
"POT-Creation-Date: 2016-01-14 01:38+0000\n" "POT-Creation-Date: 2016-01-14 01:38+0000\n"
"PO-Revision-Date: 2016-01-13 16:35+0000\n" "PO-Revision-Date: 2016-01-13 16:35+0000\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: French (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-8-0/language/fr/)\n" "Language-Team: French (http://www.transifex.com/oca/OCA-stock-logistics-"
"warehouse-8-0/language/fr/)\n"
"Language: fr\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n" "Content-Transfer-Encoding: \n"
"Language: fr\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n"
#. module: stock_available_mrp
#: model:product.product,name:stock_available_mrp.product_product_9_white
#: model:product.template,name:stock_available_mrp.product_product_9_white_product_template
msgid "Apple Wireless Keyboard"
msgstr ""
#. module: stock_available_mrp
#: model:ir.model.fields,field_description:stock_available_mrp.field_product_product_bom_id
msgid "Bill of Materials"
msgstr ""
#. module: stock_available_mrp #. module: stock_available_mrp
#: model:ir.model,name:stock_available_mrp.model_product_product #: model:ir.model,name:stock_available_mrp.model_product_product
msgid "Product" msgid "Product"
@@ -28,6 +40,13 @@ msgid "Product Template"
msgstr "Modèle de produit" msgstr "Modèle de produit"
#. module: stock_available_mrp #. module: stock_available_mrp
#: model:product.uom,name:stock_available_mrp.thousand #: model:product.product,name:stock_available_mrp.product_kit_1a
msgid "Thousand" #: model:product.template,name:stock_available_mrp.product_kit_1a_product_template
msgid "Self Build Kit"
msgstr ""
#. module: stock_available_mrp
#: model:product.product,description:stock_available_mrp.product_kit_1a
#: model:product.template,description:stock_available_mrp.product_kit_1a_product_template
msgid "Self Build kit."
msgstr "" msgstr ""

View File

@@ -1,7 +1,7 @@
# Translation of Odoo Server. # Translation of Odoo Server.
# This file contains the translation of the following modules: # This file contains the translation of the following modules:
# * stock_available_mrp # * stock_available_mrp
# #
# Translators: # Translators:
# Bole <bole@dajmi5.com>, 2016 # Bole <bole@dajmi5.com>, 2016
msgid "" msgid ""
@@ -11,28 +11,25 @@ msgstr ""
"POT-Creation-Date: 2016-06-12 19:59+0000\n" "POT-Creation-Date: 2016-06-12 19:59+0000\n"
"PO-Revision-Date: 2016-06-14 10:45+0000\n" "PO-Revision-Date: 2016-06-14 10:45+0000\n"
"Last-Translator: Bole <bole@dajmi5.com>\n" "Last-Translator: Bole <bole@dajmi5.com>\n"
"Language-Team: Croatian (Croatia) (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-9-0/language/hr_HR/)\n" "Language-Team: Croatian (Croatia) (http://www.transifex.com/oca/OCA-stock-"
"logistics-warehouse-9-0/language/hr_HR/)\n"
"Language: hr_HR\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n" "Content-Transfer-Encoding: \n"
"Language: hr_HR\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && 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" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
#. module: stock_available_mrp #. module: stock_available_mrp
#: model:ir.ui.view,arch_db:stock_available_mrp.view_product_form_potential_qty #: model:product.product,name:stock_available_mrp.product_product_9_white
msgid "<span class=\"o_stat_text\">Potential</span>" #: model:product.template,name:stock_available_mrp.product_product_9_white_product_template
msgstr "<span class=\"o_stat_text\">Potencijal</span>" msgid "Apple Wireless Keyboard"
msgstr ""
#. module: stock_available_mrp #. module: stock_available_mrp
#: model:ir.model.fields,field_description:stock_available_mrp.field_product_product_component_ids #: model:ir.model.fields,field_description:stock_available_mrp.field_product_product_bom_id
msgid "Component ids" msgid "Bill of Materials"
msgstr "ID-ovi komponenata" msgstr ""
#. module: stock_available_mrp
#: model:ir.model.fields,field_description:stock_available_mrp.field_product_product_potential_qty
#: model:ir.model.fields,field_description:stock_available_mrp.field_product_template_potential_qty
msgid "Potential"
msgstr "Potencijal"
#. module: stock_available_mrp #. module: stock_available_mrp
#: model:ir.model,name:stock_available_mrp.model_product_product #: model:ir.model,name:stock_available_mrp.model_product_product
@@ -45,21 +42,42 @@ msgid "Product Template"
msgstr "Predložak proizvoda" msgstr "Predložak proizvoda"
#. module: stock_available_mrp #. module: stock_available_mrp
#: model:ir.model.fields,help:stock_available_mrp.field_product_product_potential_qty #: model:product.product,name:stock_available_mrp.product_kit_1a
msgid "" #: model:product.template,name:stock_available_mrp.product_kit_1a_product_template
"Quantity of this Product that could be produced using the materials already " msgid "Self Build Kit"
"at hand." msgstr ""
msgstr "Količina ovog proizvoda nije mogla biti proizvedena korištenjem trenutno raspoloživih materijala."
#. module: stock_available_mrp #. module: stock_available_mrp
#: model:ir.model.fields,help:stock_available_mrp.field_product_template_potential_qty #: model:product.product,description:stock_available_mrp.product_kit_1a
msgid "" #: model:product.template,description:stock_available_mrp.product_kit_1a_product_template
"Quantity of this Product that could be produced using the materials already " msgid "Self Build kit."
"at hand. If the product has several variants, this will be the biggest " msgstr ""
"quantity that can be made for a any single variant."
msgstr "Količina ovog proizvoda koja može biti proizvodedna raspoloživim količinama sirovina. Ako proizvod ima nekoliko varijanti, ovo će biti najveća moguća količina koja se može proizvesti za svaku pojedinu varijantu."
#. module: stock_available_mrp #~ msgid "<span class=\"o_stat_text\">Potential</span>"
#: model:product.uom,name:stock_available_mrp.thousand #~ msgstr "<span class=\"o_stat_text\">Potencijal</span>"
msgid "Thousand"
msgstr "Tisuću" #~ msgid "Component ids"
#~ msgstr "ID-ovi komponenata"
#~ msgid "Potential"
#~ msgstr "Potencijal"
#~ msgid ""
#~ "Quantity of this Product that could be produced using the materials "
#~ "already at hand."
#~ msgstr ""
#~ "Količina ovog proizvoda nije mogla biti proizvedena korištenjem trenutno "
#~ "raspoloživih materijala."
#~ msgid ""
#~ "Quantity of this Product that could be produced using the materials "
#~ "already at hand. If the product has several variants, this will be the "
#~ "biggest quantity that can be made for a any single variant."
#~ msgstr ""
#~ "Količina ovog proizvoda koja može biti proizvodedna raspoloživim "
#~ "količinama sirovina. Ako proizvod ima nekoliko varijanti, ovo će biti "
#~ "najveća moguća količina koja se može proizvesti za svaku pojedinu "
#~ "varijantu."
#~ msgid "Thousand"
#~ msgstr "Tisuću"

View File

@@ -1,7 +1,7 @@
# Translation of Odoo Server. # Translation of Odoo Server.
# This file contains the translation of the following modules: # This file contains the translation of the following modules:
# * stock_available_mrp # * stock_available_mrp
# #
# Translators: # Translators:
msgid "" msgid ""
msgstr "" msgstr ""
@@ -10,27 +10,23 @@ msgstr ""
"POT-Creation-Date: 2016-09-04 10:11+0000\n" "POT-Creation-Date: 2016-09-04 10:11+0000\n"
"PO-Revision-Date: 2016-04-27 11:10+0000\n" "PO-Revision-Date: 2016-04-27 11:10+0000\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: Italian (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-9-0/language/it/)\n" "Language-Team: Italian (http://www.transifex.com/oca/OCA-stock-logistics-"
"warehouse-9-0/language/it/)\n"
"Language: it\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n" "Content-Transfer-Encoding: \n"
"Language: it\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: stock_available_mrp #. module: stock_available_mrp
#: model:ir.ui.view,arch_db:stock_available_mrp.view_product_form_potential_qty #: model:product.product,name:stock_available_mrp.product_product_9_white
msgid "<span class=\"o_stat_text\">Potential</span>" #: model:product.template,name:stock_available_mrp.product_product_9_white_product_template
msgid "Apple Wireless Keyboard"
msgstr "" msgstr ""
#. module: stock_available_mrp #. module: stock_available_mrp
#: model:ir.model.fields,field_description:stock_available_mrp.field_product_product_component_ids #: model:ir.model.fields,field_description:stock_available_mrp.field_product_product_bom_id
msgid "Component ids" msgid "Bill of Materials"
msgstr ""
#. module: stock_available_mrp
#: model:ir.model.fields,field_description:stock_available_mrp.field_product_product_potential_qty
#: model:ir.model.fields,field_description:stock_available_mrp.field_product_template_potential_qty
msgid "Potential"
msgstr "" msgstr ""
#. module: stock_available_mrp #. module: stock_available_mrp
@@ -44,21 +40,13 @@ msgid "Product Template"
msgstr "" msgstr ""
#. module: stock_available_mrp #. module: stock_available_mrp
#: model:ir.model.fields,help:stock_available_mrp.field_product_product_potential_qty #: model:product.product,name:stock_available_mrp.product_kit_1a
msgid "" #: model:product.template,name:stock_available_mrp.product_kit_1a_product_template
"Quantity of this Product that could be produced using the materials already " msgid "Self Build Kit"
"at hand."
msgstr "" msgstr ""
#. module: stock_available_mrp #. module: stock_available_mrp
#: model:ir.model.fields,help:stock_available_mrp.field_product_template_potential_qty #: model:product.product,description:stock_available_mrp.product_kit_1a
msgid "" #: model:product.template,description:stock_available_mrp.product_kit_1a_product_template
"Quantity of this Product that could be produced using the materials already " msgid "Self Build kit."
"at hand. If the product has several variants, this will be the biggest "
"quantity that can be made for a any single variant."
msgstr ""
#. module: stock_available_mrp
#: model:product.uom,name:stock_available_mrp.thousand
msgid "Thousand"
msgstr "" msgstr ""

View File

@@ -1,7 +1,7 @@
# Translation of Odoo Server. # Translation of Odoo Server.
# This file contains the translation of the following modules: # This file contains the translation of the following modules:
# * stock_available_mrp # * stock_available_mrp
# #
# Translators: # Translators:
# Claudio Araujo Santos <claudioaraujosantos@gmail.com>, 2016 # Claudio Araujo Santos <claudioaraujosantos@gmail.com>, 2016
msgid "" msgid ""
@@ -11,28 +11,24 @@ msgstr ""
"POT-Creation-Date: 2016-07-03 20:56+0000\n" "POT-Creation-Date: 2016-07-03 20:56+0000\n"
"PO-Revision-Date: 2016-07-07 19:41+0000\n" "PO-Revision-Date: 2016-07-07 19:41+0000\n"
"Last-Translator: Claudio Araujo Santos <claudioaraujosantos@gmail.com>\n" "Last-Translator: Claudio Araujo Santos <claudioaraujosantos@gmail.com>\n"
"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-9-0/language/pt_BR/)\n" "Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-stock-"
"logistics-warehouse-9-0/language/pt_BR/)\n"
"Language: pt_BR\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n" "Content-Transfer-Encoding: \n"
"Language: pt_BR\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n"
#. module: stock_available_mrp #. module: stock_available_mrp
#: model:ir.ui.view,arch_db:stock_available_mrp.view_product_form_potential_qty #: model:product.product,name:stock_available_mrp.product_product_9_white
msgid "<span class=\"o_stat_text\">Potential</span>" #: model:product.template,name:stock_available_mrp.product_product_9_white_product_template
msgstr "<span class=\"o_stat_text\">Potencial</span>" msgid "Apple Wireless Keyboard"
msgstr ""
#. module: stock_available_mrp #. module: stock_available_mrp
#: model:ir.model.fields,field_description:stock_available_mrp.field_product_product_component_ids #: model:ir.model.fields,field_description:stock_available_mrp.field_product_product_bom_id
msgid "Component ids" msgid "Bill of Materials"
msgstr "IDs de componentes" msgstr ""
#. module: stock_available_mrp
#: model:ir.model.fields,field_description:stock_available_mrp.field_product_product_potential_qty
#: model:ir.model.fields,field_description:stock_available_mrp.field_product_template_potential_qty
msgid "Potential"
msgstr "Potencial"
#. module: stock_available_mrp #. module: stock_available_mrp
#: model:ir.model,name:stock_available_mrp.model_product_product #: model:ir.model,name:stock_available_mrp.model_product_product
@@ -45,21 +41,41 @@ msgid "Product Template"
msgstr "Modelo Produto" msgstr "Modelo Produto"
#. module: stock_available_mrp #. module: stock_available_mrp
#: model:ir.model.fields,help:stock_available_mrp.field_product_product_potential_qty #: model:product.product,name:stock_available_mrp.product_kit_1a
msgid "" #: model:product.template,name:stock_available_mrp.product_kit_1a_product_template
"Quantity of this Product that could be produced using the materials already " msgid "Self Build Kit"
"at hand." msgstr ""
msgstr "Quantidade deste produto que poderia ser produzido usando os materiais já na mão."
#. module: stock_available_mrp #. module: stock_available_mrp
#: model:ir.model.fields,help:stock_available_mrp.field_product_template_potential_qty #: model:product.product,description:stock_available_mrp.product_kit_1a
msgid "" #: model:product.template,description:stock_available_mrp.product_kit_1a_product_template
"Quantity of this Product that could be produced using the materials already " msgid "Self Build kit."
"at hand. If the product has several variants, this will be the biggest " msgstr ""
"quantity that can be made for a any single variant."
msgstr "Quantidade deste produto que poderia ser produzido usando os materiais já na mão. Se o produto tiver várias variantes, esta será a maior quantidade que pode ser feito por qualquer uma única variante."
#. module: stock_available_mrp #~ msgid "<span class=\"o_stat_text\">Potential</span>"
#: model:product.uom,name:stock_available_mrp.thousand #~ msgstr "<span class=\"o_stat_text\">Potencial</span>"
msgid "Thousand"
msgstr "Mil" #~ msgid "Component ids"
#~ msgstr "IDs de componentes"
#~ msgid "Potential"
#~ msgstr "Potencial"
#~ msgid ""
#~ "Quantity of this Product that could be produced using the materials "
#~ "already at hand."
#~ msgstr ""
#~ "Quantidade deste produto que poderia ser produzido usando os materiais já "
#~ "na mão."
#~ msgid ""
#~ "Quantity of this Product that could be produced using the materials "
#~ "already at hand. If the product has several variants, this will be the "
#~ "biggest quantity that can be made for a any single variant."
#~ msgstr ""
#~ "Quantidade deste produto que poderia ser produzido usando os materiais já "
#~ "na mão. Se o produto tiver várias variantes, esta será a maior quantidade "
#~ "que pode ser feito por qualquer uma única variante."
#~ msgid "Thousand"
#~ msgstr "Mil"

View File

@@ -1,7 +1,7 @@
# Translation of Odoo Server. # Translation of Odoo Server.
# This file contains the translation of the following modules: # This file contains the translation of the following modules:
# * stock_available_mrp # * stock_available_mrp
# #
# Translators: # Translators:
# Matjaž Mozetič <m.mozetic@matmoz.si>, 2016 # Matjaž Mozetič <m.mozetic@matmoz.si>, 2016
msgid "" msgid ""
@@ -11,12 +11,25 @@ msgstr ""
"POT-Creation-Date: 2016-01-14 01:38+0000\n" "POT-Creation-Date: 2016-01-14 01:38+0000\n"
"PO-Revision-Date: 2016-01-14 05:18+0000\n" "PO-Revision-Date: 2016-01-14 05:18+0000\n"
"Last-Translator: Matjaž Mozetič <m.mozetic@matmoz.si>\n" "Last-Translator: Matjaž Mozetič <m.mozetic@matmoz.si>\n"
"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-8-0/language/sl/)\n" "Language-Team: Slovenian (http://www.transifex.com/oca/OCA-stock-logistics-"
"warehouse-8-0/language/sl/)\n"
"Language: sl\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n" "Content-Transfer-Encoding: \n"
"Language: sl\n" "Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" "%100==4 ? 2 : 3);\n"
#. module: stock_available_mrp
#: model:product.product,name:stock_available_mrp.product_product_9_white
#: model:product.template,name:stock_available_mrp.product_product_9_white_product_template
msgid "Apple Wireless Keyboard"
msgstr ""
#. module: stock_available_mrp
#: model:ir.model.fields,field_description:stock_available_mrp.field_product_product_bom_id
msgid "Bill of Materials"
msgstr ""
#. module: stock_available_mrp #. module: stock_available_mrp
#: model:ir.model,name:stock_available_mrp.model_product_product #: model:ir.model,name:stock_available_mrp.model_product_product
@@ -29,6 +42,16 @@ msgid "Product Template"
msgstr "Predloga proizvoda" msgstr "Predloga proizvoda"
#. module: stock_available_mrp #. module: stock_available_mrp
#: model:product.uom,name:stock_available_mrp.thousand #: model:product.product,name:stock_available_mrp.product_kit_1a
msgid "Thousand" #: model:product.template,name:stock_available_mrp.product_kit_1a_product_template
msgstr "Tisoč" msgid "Self Build Kit"
msgstr ""
#. module: stock_available_mrp
#: model:product.product,description:stock_available_mrp.product_kit_1a
#: model:product.template,description:stock_available_mrp.product_kit_1a_product_template
msgid "Self Build kit."
msgstr ""
#~ msgid "Thousand"
#~ msgstr "Tisoč"

View File

@@ -1,13 +1,11 @@
# Translation of OpenERP Server. # Translation of Odoo Server.
# This file contains the translation of the following modules: # This file contains the translation of the following modules:
# * stock_available_mrp # * stock_available_mrp
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: OpenERP Server 7.0\n" "Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-07-30 19:41+0000\n"
"PO-Revision-Date: 2014-07-30 19:41+0000\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@@ -16,18 +14,35 @@ msgstr ""
"Plural-Forms: \n" "Plural-Forms: \n"
#. module: stock_available_mrp #. module: stock_available_mrp
#: field:product.product,potential_qty:0 #: model:product.product,name:stock_available_mrp.product_product_9_white
msgid "Potential" #: model:product.template,name:stock_available_mrp.product_product_9_white_product_template
msgid "Apple Wireless Keyboard"
msgstr ""
#. module: stock_available_mrp
#: model:ir.model.fields,field_description:stock_available_mrp.field_product_product_bom_id
msgid "Bill of Materials"
msgstr "" msgstr ""
#. module: stock_available_mrp #. module: stock_available_mrp
#: code:_description:0
#: model:ir.model,name:stock_available_mrp.model_product_product #: model:ir.model,name:stock_available_mrp.model_product_product
#, python-format
msgid "Product" msgid "Product"
msgstr "" msgstr ""
#. module: stock_available_mrp #. module: stock_available_mrp
#: help:product.product,potential_qty:0 #: model:ir.model,name:stock_available_mrp.model_product_template
msgid "Quantity of this Product that could be produced using the materials already at hand." msgid "Product Template"
msgstr "" msgstr ""
#. module: stock_available_mrp
#: model:product.product,name:stock_available_mrp.product_kit_1a
#: model:product.template,name:stock_available_mrp.product_kit_1a_product_template
msgid "Self Build Kit"
msgstr ""
#. module: stock_available_mrp
#: model:product.product,description:stock_available_mrp.product_kit_1a
#: model:product.template,description:stock_available_mrp.product_kit_1a_product_template
msgid "Self Build kit."
msgstr ""

View File

@@ -1,7 +1,7 @@
# Translation of Odoo Server. # Translation of Odoo Server.
# This file contains the translation of the following modules: # This file contains the translation of the following modules:
# * stock_available_mrp # * stock_available_mrp
# #
# Translators: # Translators:
# Jeffery Chenn <jeffery9@gmail.com>, 2016 # Jeffery Chenn <jeffery9@gmail.com>, 2016
msgid "" msgid ""
@@ -11,28 +11,24 @@ msgstr ""
"POT-Creation-Date: 2016-08-28 10:00+0000\n" "POT-Creation-Date: 2016-08-28 10:00+0000\n"
"PO-Revision-Date: 2016-09-04 06:06+0000\n" "PO-Revision-Date: 2016-09-04 06:06+0000\n"
"Last-Translator: Jeffery Chenn <jeffery9@gmail.com>\n" "Last-Translator: Jeffery Chenn <jeffery9@gmail.com>\n"
"Language-Team: Chinese (China) (http://www.transifex.com/oca/OCA-stock-logistics-warehouse-9-0/language/zh_CN/)\n" "Language-Team: Chinese (China) (http://www.transifex.com/oca/OCA-stock-"
"logistics-warehouse-9-0/language/zh_CN/)\n"
"Language: zh_CN\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n" "Content-Transfer-Encoding: \n"
"Language: zh_CN\n"
"Plural-Forms: nplurals=1; plural=0;\n" "Plural-Forms: nplurals=1; plural=0;\n"
#. module: stock_available_mrp #. module: stock_available_mrp
#: model:ir.ui.view,arch_db:stock_available_mrp.view_product_form_potential_qty #: model:product.product,name:stock_available_mrp.product_product_9_white
msgid "<span class=\"o_stat_text\">Potential</span>" #: model:product.template,name:stock_available_mrp.product_product_9_white_product_template
msgstr "<span class=\"o_stat_text\">潜在</span>" msgid "Apple Wireless Keyboard"
#. module: stock_available_mrp
#: model:ir.model.fields,field_description:stock_available_mrp.field_product_product_component_ids
msgid "Component ids"
msgstr "" msgstr ""
#. module: stock_available_mrp #. module: stock_available_mrp
#: model:ir.model.fields,field_description:stock_available_mrp.field_product_product_potential_qty #: model:ir.model.fields,field_description:stock_available_mrp.field_product_product_bom_id
#: model:ir.model.fields,field_description:stock_available_mrp.field_product_template_potential_qty msgid "Bill of Materials"
msgid "Potential" msgstr ""
msgstr "潜在"
#. module: stock_available_mrp #. module: stock_available_mrp
#: model:ir.model,name:stock_available_mrp.model_product_product #: model:ir.model,name:stock_available_mrp.model_product_product
@@ -45,21 +41,22 @@ msgid "Product Template"
msgstr "产品模板" msgstr "产品模板"
#. module: stock_available_mrp #. module: stock_available_mrp
#: model:ir.model.fields,help:stock_available_mrp.field_product_product_potential_qty #: model:product.product,name:stock_available_mrp.product_kit_1a
msgid "" #: model:product.template,name:stock_available_mrp.product_kit_1a_product_template
"Quantity of this Product that could be produced using the materials already " msgid "Self Build Kit"
"at hand."
msgstr "" msgstr ""
#. module: stock_available_mrp #. module: stock_available_mrp
#: model:ir.model.fields,help:stock_available_mrp.field_product_template_potential_qty #: model:product.product,description:stock_available_mrp.product_kit_1a
msgid "" #: model:product.template,description:stock_available_mrp.product_kit_1a_product_template
"Quantity of this Product that could be produced using the materials already " msgid "Self Build kit."
"at hand. If the product has several variants, this will be the biggest "
"quantity that can be made for a any single variant."
msgstr "" msgstr ""
#. module: stock_available_mrp #~ msgid "<span class=\"o_stat_text\">Potential</span>"
#: model:product.uom,name:stock_available_mrp.thousand #~ msgstr "<span class=\"o_stat_text\">潜在</span>"
msgid "Thousand"
msgstr "千" #~ msgid "Potential"
#~ msgstr "潜在"
#~ msgid "Thousand"
#~ msgstr "千"

View File

@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*- # Copyright 2014 Numérigraphe SARL
# © 2014 Numérigraphe SARL
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import product_product from . import product_product

View File

@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*- # Copyright 2014 Numérigraphe SARL
# © 2014 Numérigraphe SARL
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from collections import Counter from collections import Counter
@@ -62,7 +61,7 @@ class ProductProduct(models.Model):
if not product_with_bom: if not product_with_bom:
return res, stock_dict return res, stock_dict
icp = self.env['ir.config_parameter'] icp = self.env['ir.config_parameter']
stock_available_mrp_based_on = icp.get_param( stock_available_mrp_based_on = icp.sudo().get_param(
'stock_available_mrp_based_on', 'qty_available' 'stock_available_mrp_based_on', 'qty_available'
) )
@@ -77,7 +76,7 @@ class ProductProduct(models.Model):
# Compute stock for product components. # Compute stock for product components.
# {'productid': {field_name: qty}} # {'productid': {field_name: qty}}
if res and stock_available_mrp_based_on in res.values()[0]: if res and stock_available_mrp_based_on in list(res.values())[0]:
# If the qty is computed by the same method use it to avoid # If the qty is computed by the same method use it to avoid
# stressing the cache # stressing the cache
component_qties, _ = \ component_qties, _ = \
@@ -104,12 +103,20 @@ class ProductProduct(models.Model):
# Find the lowest quantity we can make with the stock at hand # Find the lowest quantity we can make with the stock at hand
components_potential_qty = min( components_potential_qty = min(
[component_qties[component.id][ [component_qties[component.id][
stock_available_mrp_based_on] // need stock_available_mrp_based_on] / need
for component, need in component_needs.items()] for component, need in component_needs.items()]
) )
potential_qty = (product.bom_id.product_qty * bom_id = product.bom_id
components_potential_qty) potential_qty = (bom_id.product_qty * components_potential_qty)
# We want to respect the rounding factor of the potential_qty
# Rounding down as we want to be pesimistic.
potential_qty = bom_id.product_uom_id._compute_quantity(
potential_qty,
product.bom_id.product_tmpl_id.uom_id,
rounding_method='DOWN'
)
res[product.id]['potential_qty'] = potential_qty res[product.id]['potential_qty'] = potential_qty
res[product.id]['immediately_usable_qty'] += potential_qty res[product.id]['immediately_usable_qty'] += potential_qty

View File

@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*- # Copyright 2014 Numérigraphe SARL
# © 2014 Numérigraphe SARL
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models, api from odoo import models, api

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*- # Copyright 2014 Numérigraphe SARL
# © 2014 Numérigraphe SARL
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import test_potential_qty from . import test_potential_qty

View File

@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*- # Copyright 2014 Numérigraphe SARL
# © 2014 Numérigraphe SARL
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.tests.common import TransactionCase from odoo.tests.common import TransactionCase
@@ -17,7 +16,14 @@ class TestPotentialQty(TransactionCase):
self.bom_line_model = self.env["mrp.bom.line"] self.bom_line_model = self.env["mrp.bom.line"]
self.stock_quant_model = self.env["stock.quant"] self.stock_quant_model = self.env["stock.quant"]
self.config = self.env['ir.config_parameter'] self.config = self.env['ir.config_parameter']
self.location = self.env['stock.location']
# Get the warehouses
self.wh_main = self.browse_ref('stock.warehouse0')
self.wh_ch = self.browse_ref('stock.stock_warehouse_shop0')
# We need to compute parent_left and parent_right of the locations as
# they are used to compute qty_available of the product.
self.location._parent_store_compute()
self.setup_demo_data() self.setup_demo_data()
def setup_demo_data(self): def setup_demo_data(self):
@@ -26,9 +32,11 @@ class TestPotentialQty(TransactionCase):
'mrp.product_product_build_kit_product_template') 'mrp.product_product_build_kit_product_template')
#  First variant #  First variant
self.var1 = self.browse_ref('mrp.product_product_build_kit') self.var1 = self.browse_ref('mrp.product_product_build_kit')
self.var1.type = 'product'
#  Second variant #  Second variant
self.var2 = self.browse_ref( self.var2 = self.browse_ref(
'stock_available_mrp.product_kit_1a') 'stock_available_mrp.product_kit_1a')
self.var2.type = 'product'
# Components that can be used to make the product # Components that can be used to make the product
component_ids = [ component_ids = [
# KeyBoard # KeyBoard
@@ -41,15 +49,12 @@ class TestPotentialQty(TransactionCase):
for component_id in ( for component_id in (
component_ids + [v.id component_ids + [v.id
for v in self.tmpl.product_variant_ids]): for v in self.tmpl.product_variant_ids]):
inventory = self.env['stock.inventory'].create( prod = self.product_model.browse(component_id)
{'name': 'no components: %s' % component_id, self.env['stock.quant'].search([
'location_id': self.ref('stock.stock_location_locations'), ('product_id', '=', prod.id)
'filter': 'product', ]).unlink()
'product_id': component_id})
inventory.prepare_inventory()
inventory.reset_real_qty()
inventory.action_done()
self.product_model.invalidate_cache()
#  A product without a BoM #  A product without a BoM
self.product_wo_bom = self.browse_ref('product.product_product_11') self.product_wo_bom = self.browse_ref('product.product_product_11')
@@ -60,10 +65,6 @@ class TestPotentialQty(TransactionCase):
self.var2, self.var2,
self.product_wo_bom]} self.product_wo_bom]}
# Get the warehouses
self.wh_main = self.browse_ref('stock.warehouse0')
self.wh_ch = self.browse_ref('stock.stock_warehouse_shop0')
def create_inventory(self, product_id, qty, location_id=None): def create_inventory(self, product_id, qty, location_id=None):
if location_id is None: if location_id is None:
location_id = self.wh_main.lot_stock_id.id location_id = self.wh_main.lot_stock_id.id
@@ -73,8 +74,7 @@ class TestPotentialQty(TransactionCase):
'location_id': location_id, 'location_id': location_id,
'filter': 'partial' 'filter': 'partial'
}) })
inventory.prepare_inventory() inventory.action_start()
self.env['stock.inventory.line'].create({ self.env['stock.inventory.line'].create({
'inventory_id': inventory.id, 'inventory_id': inventory.id,
'product_id': product_id, 'product_id': product_id,
@@ -124,7 +124,7 @@ class TestPotentialQty(TransactionCase):
'company_id': chicago_id, 'company_id': chicago_id,
'location_id': self.wh_ch.lot_stock_id.id, 'location_id': self.wh_ch.lot_stock_id.id,
'filter': 'partial'}) 'filter': 'partial'})
inventory.prepare_inventory() inventory.action_start()
self.env['stock.inventory.line'].create( self.env['stock.inventory.line'].create(
{'inventory_id': inventory.id, {'inventory_id': inventory.id,
'company_id': chicago_id, 'company_id': chicago_id,
@@ -139,7 +139,7 @@ class TestPotentialQty(TransactionCase):
'company_id': chicago_id, 'company_id': chicago_id,
'location_id': self.wh_ch.lot_stock_id.id, 'location_id': self.wh_ch.lot_stock_id.id,
'filter': 'partial'}) 'filter': 'partial'})
inventory.prepare_inventory() inventory.action_start()
self.env['stock.inventory.line'].create( self.env['stock.inventory.line'].create(
{'inventory_id': inventory.id, {'inventory_id': inventory.id,
'company_id': chicago_id, 'company_id': chicago_id,
@@ -194,7 +194,7 @@ class TestPotentialQty(TransactionCase):
{'name': 'Receive Mouses', {'name': 'Receive Mouses',
'location_id': self.wh_main.lot_stock_id.id, 'location_id': self.wh_main.lot_stock_id.id,
'filter': 'partial'}) 'filter': 'partial'})
inventory.prepare_inventory() inventory.action_start()
self.env['stock.inventory.line'].create( self.env['stock.inventory.line'].create(
{'inventory_id': inventory.id, {'inventory_id': inventory.id,
'product_id': self.ref('product.product_product_12'), 'product_id': self.ref('product.product_product_12'),
@@ -212,7 +212,7 @@ class TestPotentialQty(TransactionCase):
{'name': 'components for 1st variant', {'name': 'components for 1st variant',
'location_id': self.wh_main.lot_stock_id.id, 'location_id': self.wh_main.lot_stock_id.id,
'filter': 'partial'}) 'filter': 'partial'})
inventory.prepare_inventory() inventory.action_start()
self.env['stock.inventory.line'].create( self.env['stock.inventory.line'].create(
{'inventory_id': inventory.id, {'inventory_id': inventory.id,
'product_id': self.ref( 'product_id': self.ref(
@@ -236,7 +236,7 @@ class TestPotentialQty(TransactionCase):
{'name': 'components for 2nd variant', {'name': 'components for 2nd variant',
'location_id': self.wh_ch.lot_stock_id.id, 'location_id': self.wh_ch.lot_stock_id.id,
'filter': 'partial'}) 'filter': 'partial'})
inventory.prepare_inventory() inventory.action_start()
self.env['stock.inventory.line'].create( self.env['stock.inventory.line'].create(
{'inventory_id': inventory.id, {'inventory_id': inventory.id,
'product_id': self.ref('product.product_product_12'), 'product_id': self.ref('product.product_product_12'),
@@ -279,17 +279,24 @@ class TestPotentialQty(TransactionCase):
def test_multi_unit_recursive_bom(self): def test_multi_unit_recursive_bom(self):
# Test multi-level and multi-units BOM # Test multi-level and multi-units BOM
uom_unit = self.env.ref('product.product_uom_unit')
uom_unit.rounding = 1.0
p1 = self.product_model.create({ p1 = self.product_model.create({
'name': 'Test product with BOM', 'name': 'Test product with BOM',
'type': 'product',
'uom_id': self.env.ref('product.product_uom_unit').id,
}) })
p2 = self.product_model.create({ p2 = self.product_model.create({
'name': 'Test sub product with BOM', 'name': 'Test sub product with BOM',
'type': 'product',
'uom_id': self.env.ref('product.product_uom_unit').id,
}) })
p3 = self.product_model.create({ p3 = self.product_model.create({
'name': 'Test component' 'name': 'Test component',
'type': 'product',
'uom_id': self.env.ref('product.product_uom_unit').id,
}) })
bom_p1 = self.bom_model.create({ bom_p1 = self.bom_model.create({
@@ -301,6 +308,8 @@ class TestPotentialQty(TransactionCase):
'bom_id': bom_p1.id, 'bom_id': bom_p1.id,
'product_id': p3.id, 'product_id': p3.id,
'product_qty': 1, 'product_qty': 1,
'product_uom_id': self.env.ref('product.product_uom_unit').id,
}) })
# Two p2 which have a bom # Two p2 which have a bom
@@ -308,6 +317,8 @@ class TestPotentialQty(TransactionCase):
'bom_id': bom_p1.id, 'bom_id': bom_p1.id,
'product_id': p2.id, 'product_id': p2.id,
'product_qty': 2, 'product_qty': 2,
'product_uom_id': self.env.ref('product.product_uom_unit').id,
}) })
bom_p2 = self.bom_model.create({ bom_p2 = self.bom_model.create({
@@ -321,6 +332,8 @@ class TestPotentialQty(TransactionCase):
'bom_id': bom_p2.id, 'bom_id': bom_p2.id,
'product_id': p3.id, 'product_id': p3.id,
'product_qty': 2, 'product_qty': 2,
'product_uom_id': self.env.ref('product.product_uom_unit').id,
}) })
p1.refresh() p1.refresh()
@@ -329,7 +342,6 @@ class TestPotentialQty(TransactionCase):
self.assertEqual(0, p1.potential_qty) self.assertEqual(0, p1.potential_qty)
self.create_inventory(p3.id, 1) self.create_inventory(p3.id, 1)
p1.refresh() p1.refresh()
self.assertEqual(0, p1.potential_qty) self.assertEqual(0, p1.potential_qty)
@@ -389,6 +401,7 @@ class TestPotentialQty(TransactionCase):
# If iMac has a Bom and can be manufactured # If iMac has a Bom and can be manufactured
component = self.product_model.create({ component = self.product_model.create({
'name': 'component', 'name': 'component',
'type': 'product'
}) })
self.create_inventory(component.id, 5) self.create_inventory(component.id, 5)
@@ -415,14 +428,14 @@ class TestPotentialQty(TransactionCase):
p1.refresh() p1.refresh()
self.assertEqual(5.0, p1.potential_qty) self.assertEqual(5.0, p1.potential_qty)
def test_potential_qty__list(self): def test_potential_qty_list(self):
# Try to highlight a bug when _get_potential_qty is called on # Try to highlight a bug when _get_potential_qty is called on
# a recordset with multiple products # a recordset with multiple products
# Recursive compute is not working # Recursive compute is not working
p1 = self.product_model.create({'name': 'Test P1'}) p1 = self.product_model.create({'name': 'Test P1'})
p2 = self.product_model.create({'name': 'Test P2'}) p2 = self.product_model.create({'name': 'Test P2'})
p3 = self.product_model.create({'name': 'Test P3'}) p3 = self.product_model.create({'name': 'Test P3', 'type': 'product'})
self.config.set_param('stock_available_mrp_based_on', self.config.set_param('stock_available_mrp_based_on',
'immediately_usable_qty') 'immediately_usable_qty')