From 67e2352783acb64210ecc00a633f9b666619ab5f Mon Sep 17 00:00:00 2001
From: ernesto
Date: Thu, 19 Sep 2019 13:04:31 -0400
Subject: [PATCH 01/31] [ADD] stock_product_pack: new module
---
stock_product_pack/README.rst | 110 +++++
stock_product_pack/__init__.py | 2 +
stock_product_pack/__manifest__.py | 24 +
stock_product_pack/i18n/es.po | 22 +
stock_product_pack/models/__init__.py | 3 +
stock_product_pack/models/product_product.py | 37 ++
stock_product_pack/readme/CONFIGURE.rst | 6 +
stock_product_pack/readme/CONTRIBUTORS.rst | 5 +
stock_product_pack/readme/DESCRIPTION.rst | 2 +
stock_product_pack/readme/USAGE.rst | 8 +
.../static/description/index.html | 452 ++++++++++++++++++
stock_product_pack/tests/__init__.py | 3 +
.../tests/test_stock_product_pack.py | 80 ++++
13 files changed, 754 insertions(+)
create mode 100644 stock_product_pack/README.rst
create mode 100644 stock_product_pack/__init__.py
create mode 100644 stock_product_pack/__manifest__.py
create mode 100644 stock_product_pack/i18n/es.po
create mode 100644 stock_product_pack/models/__init__.py
create mode 100644 stock_product_pack/models/product_product.py
create mode 100644 stock_product_pack/readme/CONFIGURE.rst
create mode 100644 stock_product_pack/readme/CONTRIBUTORS.rst
create mode 100644 stock_product_pack/readme/DESCRIPTION.rst
create mode 100644 stock_product_pack/readme/USAGE.rst
create mode 100644 stock_product_pack/static/description/index.html
create mode 100644 stock_product_pack/tests/__init__.py
create mode 100644 stock_product_pack/tests/test_stock_product_pack.py
diff --git a/stock_product_pack/README.rst b/stock_product_pack/README.rst
new file mode 100644
index 000000000..856de3a65
--- /dev/null
+++ b/stock_product_pack/README.rst
@@ -0,0 +1,110 @@
+==================
+Stock product Pack
+==================
+
+.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ !! 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%2Fproduct--pack-lightgray.png?logo=github
+ :target: https://github.com/OCA/product-pack/tree/12.0/stock_product_pack
+ :alt: OCA/product-pack
+.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
+ :target: https://translation.odoo-community.org/projects/product-pack-12-0/product-pack-12-0-stock_product_pack
+ :alt: Translate me on Weblate
+.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
+ :target: https://runbot.odoo-community.org/runbot/286/12.0
+ :alt: Try me on Runbot
+
+|badge1| |badge2| |badge3| |badge4| |badge5|
+
+This module allows you to get the right available *On Hand* and *Forecasted*
+quantities of the packs.
+
+**Table of contents**
+
+.. contents::
+ :local:
+
+Configuration
+=============
+
+To configure this module, you need to:
+
+#. Go to *Inventory -> Master Data -> Product*, create a product and check
+ "Is Pack?" field, then set the products has to include in the Pack.
+#. Set type of product pack.
+
+
+Usage
+=====
+
+To use this module, you need to:
+
+#. Go to *Inventory -> Operations -> Transfers* and create transfer related to
+ components of a Pack 'X'.
+#. Then go to *Inventory -> Master Data -> Product*, find the Pack 'X' and you
+ will see in the smart buttons that show *On Hand* and *Forecasted* the
+ quantities based on the *On Hand* and *Forecasted* quantities of
+ its components. That is the minimum quantities of its components.
+
+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
+~~~~~~~
+
+* NaN·tic
+* ADHOC SA
+* Tecnativa
+
+Contributors
+~~~~~~~~~~~~
+
+* `Tecnativa `_:
+
+ * Ernesto Tejeda
+ * Pedro M. Baeza
+ * Sergio Teruel
+
+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.
+
+.. |maintainer-ernestotejeda| image:: https://github.com/ernestotejeda.png?size=40px
+ :target: https://github.com/ernestotejeda
+ :alt: ernestotejeda
+
+Current `maintainer `__:
+
+|maintainer-ernestotejeda|
+
+This module is part of the `OCA/product-pack `_ project on GitHub.
+
+You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/stock_product_pack/__init__.py b/stock_product_pack/__init__.py
new file mode 100644
index 000000000..cb45f2710
--- /dev/null
+++ b/stock_product_pack/__init__.py
@@ -0,0 +1,2 @@
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+from . import models
diff --git a/stock_product_pack/__manifest__.py b/stock_product_pack/__manifest__.py
new file mode 100644
index 000000000..81689daf4
--- /dev/null
+++ b/stock_product_pack/__manifest__.py
@@ -0,0 +1,24 @@
+# Copyright 2019 NaN (http://www.nan-tic.com) - Àngel Àlvarez
+# Copyright 2019 Tecnativa - Ernesto Tejeda
+# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
+{
+ 'name': 'Stock product Pack',
+ 'version': '12.0.1.0.0',
+ 'category': 'Warehouse',
+ 'summary': 'This module allows you to get the right available quantities '
+ 'of the packs',
+ 'website': 'https://github.com/OCA/product-pack',
+ 'author': 'NaN·tic, '
+ 'ADHOC SA, '
+ 'Tecnativa, '
+ 'Odoo Community Association (OCA)',
+ 'maintainers': ['ernestotejeda'],
+ 'license': 'AGPL-3',
+ 'depends': [
+ 'product_pack',
+ 'stock',
+ ],
+ 'installable': True,
+ 'auto_install': True,
+ 'application': False,
+}
diff --git a/stock_product_pack/i18n/es.po b/stock_product_pack/i18n/es.po
new file mode 100644
index 000000000..15ebbb444
--- /dev/null
+++ b/stock_product_pack/i18n/es.po
@@ -0,0 +1,22 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * stock_product_pack
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 12.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2019-09-18 14:54+0000\n"
+"PO-Revision-Date: 2019-09-18 14:54+0000\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_product_pack
+#: model:ir.model,name:stock_product_pack.model_product_product
+msgid "Product"
+msgstr "Producto"
+
diff --git a/stock_product_pack/models/__init__.py b/stock_product_pack/models/__init__.py
new file mode 100644
index 000000000..586a7eff4
--- /dev/null
+++ b/stock_product_pack/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_product_pack/models/product_product.py b/stock_product_pack/models/product_product.py
new file mode 100644
index 000000000..f7c75a690
--- /dev/null
+++ b/stock_product_pack/models/product_product.py
@@ -0,0 +1,37 @@
+# Copyright 2019 Tecnativa - Ernesto Tejeda
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+
+from odoo import models
+import math
+
+
+class ProductProduct(models.Model):
+ _inherit = 'product.product'
+
+ def _compute_quantities_dict(
+ self, lot_id, owner_id, package_id,
+ from_date=False, to_date=False):
+ res = super()._compute_quantities_dict(
+ lot_id, owner_id, package_id, from_date=from_date, to_date=to_date)
+ packs = self.filtered('pack_ok')
+ for product in packs.with_context(prefetch_fields=False):
+ pack_qty_available = []
+ pack_virtual_available = []
+ for subproduct in product.pack_line_ids:
+ subproduct_stock = subproduct.product_id
+ sub_qty = subproduct.quantity
+ if sub_qty:
+ pack_qty_available.append(math.floor(
+ subproduct_stock.qty_available / sub_qty))
+ pack_virtual_available.append(math.floor(
+ subproduct_stock.virtual_available / sub_qty))
+ res[product.id] = {
+ 'qty_available': (
+ pack_qty_available and min(pack_qty_available) or False),
+ 'incoming_qty': 0,
+ 'outgoing_qty': 0,
+ 'virtual_available': (
+ pack_virtual_available and
+ min(pack_virtual_available) or False),
+ }
+ return res
diff --git a/stock_product_pack/readme/CONFIGURE.rst b/stock_product_pack/readme/CONFIGURE.rst
new file mode 100644
index 000000000..158211068
--- /dev/null
+++ b/stock_product_pack/readme/CONFIGURE.rst
@@ -0,0 +1,6 @@
+To configure this module, you need to:
+
+#. Go to *Inventory -> Master Data -> Product*, create a product and check
+ "Is Pack?" field, then set the products has to include in the Pack.
+#. Set type of product pack.
+
diff --git a/stock_product_pack/readme/CONTRIBUTORS.rst b/stock_product_pack/readme/CONTRIBUTORS.rst
new file mode 100644
index 000000000..0c7110256
--- /dev/null
+++ b/stock_product_pack/readme/CONTRIBUTORS.rst
@@ -0,0 +1,5 @@
+* `Tecnativa `_:
+
+ * Ernesto Tejeda
+ * Pedro M. Baeza
+ * Sergio Teruel
diff --git a/stock_product_pack/readme/DESCRIPTION.rst b/stock_product_pack/readme/DESCRIPTION.rst
new file mode 100644
index 000000000..f93336075
--- /dev/null
+++ b/stock_product_pack/readme/DESCRIPTION.rst
@@ -0,0 +1,2 @@
+This module allows you to get the right available *On Hand* and *Forecasted*
+quantities of the packs.
diff --git a/stock_product_pack/readme/USAGE.rst b/stock_product_pack/readme/USAGE.rst
new file mode 100644
index 000000000..db8b69e59
--- /dev/null
+++ b/stock_product_pack/readme/USAGE.rst
@@ -0,0 +1,8 @@
+To use this module, you need to:
+
+#. Go to *Inventory -> Operations -> Transfers* and create transfer related to
+ components of a Pack 'X'.
+#. Then go to *Inventory -> Master Data -> Product*, find the Pack 'X' and you
+ will see in the smart buttons that show *On Hand* and *Forecasted* the
+ quantities based on the *On Hand* and *Forecasted* quantities of
+ its components. That is the minimum quantities of its components.
diff --git a/stock_product_pack/static/description/index.html b/stock_product_pack/static/description/index.html
new file mode 100644
index 000000000..1db793079
--- /dev/null
+++ b/stock_product_pack/static/description/index.html
@@ -0,0 +1,452 @@
+
+
+
+
+
+
+Stock product Pack
+
+
+
+
+
Stock product Pack
+
+
+

+
This module allows you to get the right available On Hand and Forecasted
+quantities of the packs.
+
Table of contents
+
+
+
+
To configure this module, you need to:
+
+- Go to Inventory -> Master Data -> Product, create a product and check
+“Is Pack?” field, then set the products has to include in the Pack.
+- Set type of product pack.
+
+
+
+
+
To use this module, you need to:
+
+- Go to Inventory -> Operations -> Transfers and create transfer related to
+components of a Pack ‘X’.
+- Then go to Inventory -> Master Data -> Product, find the Pack ‘X’ and you
+will see in the smart buttons that show On Hand and Forecasted the
+quantities based on the On Hand and Forecasted quantities of
+its components. That is the minimum quantities of its components.
+
+
+
+
+
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.
+
+
+
+
+
+
+- NaN·tic
+- ADHOC SA
+- Tecnativa
+
+
+
+
+
+- Tecnativa:
+- Ernesto Tejeda
+- Pedro M. Baeza
+- Sergio Teruel
+
+
+
+
+
+
+
This module is maintained by the OCA.
+

+
OCA, or the Odoo Community Association, is a nonprofit organization whose
+mission is to support the collaborative development of Odoo features and
+promote its widespread use.
+
Current maintainer:
+

+
This module is part of the OCA/product-pack project on GitHub.
+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
+
+
+
+
+
diff --git a/stock_product_pack/tests/__init__.py b/stock_product_pack/tests/__init__.py
new file mode 100644
index 000000000..21c96b0cc
--- /dev/null
+++ b/stock_product_pack/tests/__init__.py
@@ -0,0 +1,3 @@
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+
+from . import test_stock_product_pack
diff --git a/stock_product_pack/tests/test_stock_product_pack.py b/stock_product_pack/tests/test_stock_product_pack.py
new file mode 100644
index 000000000..2c6ff7440
--- /dev/null
+++ b/stock_product_pack/tests/test_stock_product_pack.py
@@ -0,0 +1,80 @@
+# Copyright 2019 Tecnativa - Ernesto Tejeda
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+
+from odoo.tests import SavepointCase
+import logging
+
+_logger = logging.getLogger(__name__)
+
+
+class TestSaleProductPack(SavepointCase):
+
+ @classmethod
+ def setUpClass(cls):
+ super().setUpClass()
+ category_all_id = cls.env.ref('product.product_category_all').id
+ product_obj = cls.env['product.product']
+ cls.pack_dc = cls.env['product.product'].create({
+ 'name': 'Pack',
+ 'type': 'product',
+ 'pack_ok': True,
+ 'pack_type': 'detailed',
+ 'pack_component_price': 'detailed',
+ 'categ_id': category_all_id,
+ 'pack_line_ids': [
+ (0, 0, {
+ 'product_id': product_obj.create({
+ 'name': 'Component 1',
+ 'type': 'product',
+ 'categ_id': category_all_id,
+ }).id,
+ 'quantity': 1,
+ }),
+ (0, 0, {
+ 'product_id': product_obj.create({
+ 'name': 'Component 2',
+ 'type': 'product',
+ 'categ_id': category_all_id,
+ }).id,
+ 'quantity': 1,
+ }),
+ ]
+ })
+
+ def test_compute_quantities_dict(self):
+ location_id = self.env.ref('stock.stock_location_suppliers').id,
+ location_dest_id = self.env.ref('stock.stock_location_stock').id,
+ components = self.pack_dc.pack_line_ids.mapped('product_id')
+ picking = self.env['stock.picking'].create({
+ 'partner_id': self.env.ref('base.res_partner_4').id,
+ 'picking_type_id': self.env.ref('stock.picking_type_in').id,
+ 'location_id': location_id,
+ 'location_dest_id': location_dest_id,
+ 'move_lines': [
+ (0, 0, {
+ 'name': 'incoming_move_test_01',
+ 'product_id': components[0].id,
+ 'product_uom_qty': 5,
+ 'product_uom': components[0].uom_id.id,
+ 'location_id': location_id,
+ 'location_dest_id': location_dest_id,
+ }),
+ (0, 0, {
+ 'name': 'incoming_move_test_02',
+ 'product_id': components[1].id,
+ 'product_uom_qty': 7,
+ 'product_uom': components[1].uom_id.id,
+ 'location_id': location_id,
+ 'location_dest_id': location_dest_id,
+ }),
+ ]
+ })
+ picking.action_confirm()
+ self.assertEqual(self.pack_dc.virtual_available, 5)
+ self.assertEqual(self.pack_dc.qty_available, 0)
+ wizard_dict = picking.button_validate()
+ wizard = self.env[wizard_dict['res_model']].browse(
+ wizard_dict['res_id'])
+ wizard.process()
+ self.assertEqual(self.pack_dc.virtual_available, 5)
+ self.assertEqual(self.pack_dc.qty_available, 5)
From 2ae265f95a9cf5887ac04f62ae8ee7667a419250 Mon Sep 17 00:00:00 2001
From: OCA-git-bot
Date: Tue, 22 Oct 2019 15:57:07 +0000
Subject: [PATCH 02/31] [ADD] icon.png
---
stock_product_pack/i18n/es.po | 4 ++--
.../i18n/stock_product_pack.pot | 20 ++++++++++++++++++
.../static/description/icon.png | Bin 0 -> 9455 bytes
3 files changed, 22 insertions(+), 2 deletions(-)
create mode 100644 stock_product_pack/i18n/stock_product_pack.pot
create mode 100644 stock_product_pack/static/description/icon.png
diff --git a/stock_product_pack/i18n/es.po b/stock_product_pack/i18n/es.po
index 15ebbb444..9be1296dc 100644
--- a/stock_product_pack/i18n/es.po
+++ b/stock_product_pack/i18n/es.po
@@ -1,6 +1,6 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
-# * stock_product_pack
+# * stock_product_pack
#
msgid ""
msgstr ""
@@ -10,6 +10,7 @@ msgstr ""
"PO-Revision-Date: 2019-09-18 14:54+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
+"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
@@ -19,4 +20,3 @@ msgstr ""
#: model:ir.model,name:stock_product_pack.model_product_product
msgid "Product"
msgstr "Producto"
-
diff --git a/stock_product_pack/i18n/stock_product_pack.pot b/stock_product_pack/i18n/stock_product_pack.pot
new file mode 100644
index 000000000..9a5bc0927
--- /dev/null
+++ b/stock_product_pack/i18n/stock_product_pack.pot
@@ -0,0 +1,20 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * stock_product_pack
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 12.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_product_pack
+#: model:ir.model,name:stock_product_pack.model_product_product
+msgid "Product"
+msgstr ""
+
diff --git a/stock_product_pack/static/description/icon.png b/stock_product_pack/static/description/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..3a0328b516c4980e8e44cdb63fd945757ddd132d
GIT binary patch
literal 9455
zcmW++2RxMjAAjx~&dlBk9S+%}OXg)AGE&Cb*&}d0jUxM@u(PQx^-s)697TX`ehR4?GS^qbkof1cslKgkU)h65qZ9Oc=ml_0temigYLJfnz{IDzUf>bGs4N!v3=Z3jMq&A#7%rM5eQ#dc?k~!
zVpnB`o+K7|Al`Q_U;eD$B
zfJtP*jH`siUq~{KE)`jP2|#TUEFGRryE2`i0**z#*^6~AI|YzIWy$Cu#CSLW3q=GA
z6`?GZymC;dCPk~rBS%eCb`5OLr;RUZ;D`}um=H)BfVIq%7VhiMr)_#G0N#zrNH|__
zc+blN2UAB0=617@>_u;MPHN;P;N#YoE=)R#i$k_`UAA>WWCcEVMh~L_
zj--gtp&|K1#58Yz*AHCTMziU1Jzt_jG0I@qAOHsk$2}yTmVkBp_eHuY$A9)>P6o~I
z%aQ?!(GqeQ-Y+b0I(m9pwgi(IIZZzsbMv+9w{PFtd_<_(LA~0H(xz{=FhLB@(1&qHA5EJw1>>=%q2f&^X>IQ{!GJ4e9U
z&KlB)z(84HmNgm2hg2C0>WM{E(DdPr+EeU_N@57;PC2&DmGFW_9kP&%?X4}+xWi)(
z;)z%wI5>D4a*5XwD)P--sPkoY(a~WBw;E~AW`Yue4kFa^LM3X`8x|}ZUeMnqr}>k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_3be)Lkn#0F*V8Pq
zc}`Cjy$bE;FJ6H7p=0y#R>`}-m4(0F>%@P|?7fx{=R^uFdISRnZ2W_xQhD{YuR3t<
z{6yxu=4~JkeA;|(J6_nv#>Nvs&FuLA&PW^he@t(UwFFE8)|a!R{`E`K`i^ZnyE4$k
z;(749Ix|oi$c3QbEJ3b~D_kQsPz~fIUKym($a_7dJ?o+40*OLl^{=&oq$<#Q(yyrp
z{J-FAniyAw9tPbe&IhQ|a`DqFTVQGQ&Gq3!C2==4x{6EJwiPZ8zub-iXoUtkJiG{}
zPaR&}_fn8_z~(=;5lD-aPWD3z8PZS@AaUiomF!G8I}Mf>e~0g#BelA-5#`cj;O5>N
Xviia!U7SGha1wx#SCgwmn*{w2TRX*I
literal 0
HcmV?d00001
From 970ef813d34e18a8e193734780e87141d97f08b4 Mon Sep 17 00:00:00 2001
From: ernesto
Date: Tue, 22 Oct 2019 16:20:03 -0400
Subject: [PATCH 03/31] [IMP] stock_product_pack: improve description and usage
readme section
---
stock_product_pack/README.rst | 17 +++-----
stock_product_pack/readme/CONFIGURE.rst | 6 ---
stock_product_pack/readme/DESCRIPTION.rst | 4 +-
stock_product_pack/readme/USAGE.rst | 3 ++
.../static/description/index.html | 41 ++++++++-----------
5 files changed, 27 insertions(+), 44 deletions(-)
delete mode 100644 stock_product_pack/readme/CONFIGURE.rst
diff --git a/stock_product_pack/README.rst b/stock_product_pack/README.rst
index 856de3a65..4624f0a10 100644
--- a/stock_product_pack/README.rst
+++ b/stock_product_pack/README.rst
@@ -25,29 +25,22 @@ Stock product Pack
|badge1| |badge2| |badge3| |badge4| |badge5|
-This module allows you to get the right available *On Hand* and *Forecasted*
-quantities of the packs.
+This module allows you to get *On Hand* and *Forecasted* values calculated from
+components of the pack.
**Table of contents**
.. contents::
:local:
-Configuration
-=============
-
-To configure this module, you need to:
-
-#. Go to *Inventory -> Master Data -> Product*, create a product and check
- "Is Pack?" field, then set the products has to include in the Pack.
-#. Set type of product pack.
-
-
Usage
=====
To use this module, you need to:
+#. Go to *Inventory -> Master Data -> Product*, create a product and check
+ "Is Pack?" field then set Pack Type and Pack component price.
+#. Choose products to include in the pack.
#. Go to *Inventory -> Operations -> Transfers* and create transfer related to
components of a Pack 'X'.
#. Then go to *Inventory -> Master Data -> Product*, find the Pack 'X' and you
diff --git a/stock_product_pack/readme/CONFIGURE.rst b/stock_product_pack/readme/CONFIGURE.rst
deleted file mode 100644
index 158211068..000000000
--- a/stock_product_pack/readme/CONFIGURE.rst
+++ /dev/null
@@ -1,6 +0,0 @@
-To configure this module, you need to:
-
-#. Go to *Inventory -> Master Data -> Product*, create a product and check
- "Is Pack?" field, then set the products has to include in the Pack.
-#. Set type of product pack.
-
diff --git a/stock_product_pack/readme/DESCRIPTION.rst b/stock_product_pack/readme/DESCRIPTION.rst
index f93336075..b7a03ce15 100644
--- a/stock_product_pack/readme/DESCRIPTION.rst
+++ b/stock_product_pack/readme/DESCRIPTION.rst
@@ -1,2 +1,2 @@
-This module allows you to get the right available *On Hand* and *Forecasted*
-quantities of the packs.
+This module allows you to get *On Hand* and *Forecasted* values calculated from
+components of the pack.
diff --git a/stock_product_pack/readme/USAGE.rst b/stock_product_pack/readme/USAGE.rst
index db8b69e59..40b2439e7 100644
--- a/stock_product_pack/readme/USAGE.rst
+++ b/stock_product_pack/readme/USAGE.rst
@@ -1,5 +1,8 @@
To use this module, you need to:
+#. Go to *Inventory -> Master Data -> Product*, create a product and check
+ "Is Pack?" field then set Pack Type and Pack component price.
+#. Choose products to include in the pack.
#. Go to *Inventory -> Operations -> Transfers* and create transfer related to
components of a Pack 'X'.
#. Then go to *Inventory -> Master Data -> Product*, find the Pack 'X' and you
diff --git a/stock_product_pack/static/description/index.html b/stock_product_pack/static/description/index.html
index 1db793079..5af35443f 100644
--- a/stock_product_pack/static/description/index.html
+++ b/stock_product_pack/static/description/index.html
@@ -368,35 +368,28 @@ Stock product Pack
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

-This module allows you to get the right available On Hand and Forecasted
-quantities of the packs.
+This module allows you to get On Hand and Forecasted values calculated from
+components of the pack.
Table of contents
-
-
-
To configure this module, you need to:
-
-- Go to Inventory -> Master Data -> Product, create a product and check
-“Is Pack?” field, then set the products has to include in the Pack.
-- Set type of product pack.
-
-
-
+
To use this module, you need to:
+- Go to Inventory -> Master Data -> Product, create a product and check
+“Is Pack?” field then set Pack Type and Pack component price.
+- Choose products to include in the pack.
- Go to Inventory -> Operations -> Transfers and create transfer related to
components of a Pack ‘X’.
- Then go to Inventory -> Master Data -> Product, find the Pack ‘X’ and you
@@ -406,7 +399,7 @@
-
+
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
@@ -414,9 +407,9 @@
Do not contact contributors directly about support or help with technical issues.
-
+
-
+
- NaN·tic
- ADHOC SA
@@ -424,7 +417,7 @@
-
+
- Tecnativa:
- Ernesto Tejeda
@@ -435,7 +428,7 @@
-
+
This module is maintained by the OCA.
OCA, or the Odoo Community Association, is a nonprofit organization whose
From 5b8f44bf2a6918c1f4bcc240cdaba21343db1af3 Mon Sep 17 00:00:00 2001
From: Pedro Castro Silva
Date: Thu, 12 Dec 2019 19:31:43 +0000
Subject: [PATCH 04/31] Added translation using Weblate (Portuguese)
---
stock_product_pack/i18n/pt.po | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
create mode 100644 stock_product_pack/i18n/pt.po
diff --git a/stock_product_pack/i18n/pt.po b/stock_product_pack/i18n/pt.po
new file mode 100644
index 000000000..0977feefd
--- /dev/null
+++ b/stock_product_pack/i18n/pt.po
@@ -0,0 +1,20 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * stock_product_pack
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 12.0\n"
+"Report-Msgid-Bugs-To: \n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: none\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_product_pack
+#: model:ir.model,name:stock_product_pack.model_product_product
+msgid "Product"
+msgstr ""
From a954c3ac3182820232b4951f182600eccac7dcea Mon Sep 17 00:00:00 2001
From: Pedro Castro Silva
Date: Thu, 12 Dec 2019 19:31:53 +0000
Subject: [PATCH 05/31] Translated using Weblate (Portuguese)
Currently translated at 100.0% (1 of 1 strings)
Translation: product-pack-12.0/product-pack-12.0-stock_product_pack
Translate-URL: https://translation.odoo-community.org/projects/product-pack-12-0/product-pack-12-0-stock_product_pack/pt/
---
stock_product_pack/i18n/pt.po | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/stock_product_pack/i18n/pt.po b/stock_product_pack/i18n/pt.po
index 0977feefd..99ce2bd80 100644
--- a/stock_product_pack/i18n/pt.po
+++ b/stock_product_pack/i18n/pt.po
@@ -6,15 +6,17 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
-"Last-Translator: Automatically generated\n"
+"PO-Revision-Date: 2019-12-12 22:05+0000\n"
+"Last-Translator: Pedro Castro Silva \n"
"Language-Team: none\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"
+"X-Generator: Weblate 3.9.1\n"
#. module: stock_product_pack
#: model:ir.model,name:stock_product_pack.model_product_product
msgid "Product"
-msgstr ""
+msgstr "Produto"
From 0d9577b67d8743d3ce700a8511452e46806b40ed Mon Sep 17 00:00:00 2001
From: Azucena Luque
Date: Wed, 29 Apr 2020 15:11:10 +0200
Subject: [PATCH 06/31] [FIX] stock_product_pack: only use stockable products
to calculate the stock.
---
stock_product_pack/__manifest__.py | 2 +-
stock_product_pack/models/product_product.py | 4 +++-
.../tests/test_stock_product_pack.py | 16 ++++++++++++++++
3 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/stock_product_pack/__manifest__.py b/stock_product_pack/__manifest__.py
index 81689daf4..1eb726382 100644
--- a/stock_product_pack/__manifest__.py
+++ b/stock_product_pack/__manifest__.py
@@ -3,7 +3,7 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
'name': 'Stock product Pack',
- 'version': '12.0.1.0.0',
+ 'version': '12.0.1.0.1',
'category': 'Warehouse',
'summary': 'This module allows you to get the right available quantities '
'of the packs',
diff --git a/stock_product_pack/models/product_product.py b/stock_product_pack/models/product_product.py
index f7c75a690..78b0f9467 100644
--- a/stock_product_pack/models/product_product.py
+++ b/stock_product_pack/models/product_product.py
@@ -17,7 +17,9 @@ def _compute_quantities_dict(
for product in packs.with_context(prefetch_fields=False):
pack_qty_available = []
pack_virtual_available = []
- for subproduct in product.pack_line_ids:
+ subproducts = product.pack_line_ids.filtered(
+ lambda p: p.product_id.type == 'product')
+ for subproduct in subproducts:
subproduct_stock = subproduct.product_id
sub_qty = subproduct.quantity
if sub_qty:
diff --git a/stock_product_pack/tests/test_stock_product_pack.py b/stock_product_pack/tests/test_stock_product_pack.py
index 2c6ff7440..0211d9852 100644
--- a/stock_product_pack/tests/test_stock_product_pack.py
+++ b/stock_product_pack/tests/test_stock_product_pack.py
@@ -38,6 +38,22 @@ def setUpClass(cls):
}).id,
'quantity': 1,
}),
+ (0, 0, {
+ 'product_id': product_obj.create({
+ 'name': 'Component 3',
+ 'type': 'service',
+ 'categ_id': category_all_id,
+ }).id,
+ 'quantity': 1,
+ }),
+ (0, 0, {
+ 'product_id': product_obj.create({
+ 'name': 'Component 4',
+ 'type': 'consu',
+ 'categ_id': category_all_id,
+ }).id,
+ 'quantity': 1,
+ }),
]
})
From 960faee8057e46ae907c731a5c109e8f2b5d174f Mon Sep 17 00:00:00 2001
From: Yann Papouin
Date: Thu, 28 May 2020 09:23:10 +0000
Subject: [PATCH 07/31] Added translation using Weblate (French)
---
stock_product_pack/i18n/fr.po | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
create mode 100644 stock_product_pack/i18n/fr.po
diff --git a/stock_product_pack/i18n/fr.po b/stock_product_pack/i18n/fr.po
new file mode 100644
index 000000000..1ae854f65
--- /dev/null
+++ b/stock_product_pack/i18n/fr.po
@@ -0,0 +1,20 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * stock_product_pack
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 12.0\n"
+"Report-Msgid-Bugs-To: \n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: none\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_product_pack
+#: model:ir.model,name:stock_product_pack.model_product_product
+msgid "Product"
+msgstr ""
From 0d0b20e14d79d344379cff976bbb0b1874c1a1f1 Mon Sep 17 00:00:00 2001
From: Yann Papouin
Date: Thu, 28 May 2020 09:23:29 +0000
Subject: [PATCH 08/31] Translated using Weblate (French)
Currently translated at 100.0% (1 of 1 strings)
Translation: product-pack-12.0/product-pack-12.0-stock_product_pack
Translate-URL: https://translation.odoo-community.org/projects/product-pack-12-0/product-pack-12-0-stock_product_pack/fr/
---
stock_product_pack/i18n/fr.po | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/stock_product_pack/i18n/fr.po b/stock_product_pack/i18n/fr.po
index 1ae854f65..4e06b0c76 100644
--- a/stock_product_pack/i18n/fr.po
+++ b/stock_product_pack/i18n/fr.po
@@ -6,15 +6,17 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
-"Last-Translator: Automatically generated\n"
+"PO-Revision-Date: 2020-05-28 12:19+0000\n"
+"Last-Translator: Yann Papouin \n"
"Language-Team: none\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.10\n"
#. module: stock_product_pack
#: model:ir.model,name:stock_product_pack.model_product_product
msgid "Product"
-msgstr ""
+msgstr "Article"
From 50bf589921c94da817082af42b7c77c81e6d0765 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jo=C3=A3o=20Marques?=
Date: Fri, 18 Sep 2020 15:43:01 +0200
Subject: [PATCH 09/31] [IMP] stock_product_pack: black, isort, prettier
---
stock_product_pack/__manifest__.py | 32 ++-
stock_product_pack/models/product_product.py | 42 ++--
.../tests/test_stock_product_pack.py | 185 +++++++++++-------
3 files changed, 147 insertions(+), 112 deletions(-)
diff --git a/stock_product_pack/__manifest__.py b/stock_product_pack/__manifest__.py
index 1eb726382..e3ce18c7e 100644
--- a/stock_product_pack/__manifest__.py
+++ b/stock_product_pack/__manifest__.py
@@ -2,23 +2,17 @@
# Copyright 2019 Tecnativa - Ernesto Tejeda
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
- 'name': 'Stock product Pack',
- 'version': '12.0.1.0.1',
- 'category': 'Warehouse',
- 'summary': 'This module allows you to get the right available quantities '
- 'of the packs',
- 'website': 'https://github.com/OCA/product-pack',
- 'author': 'NaN·tic, '
- 'ADHOC SA, '
- 'Tecnativa, '
- 'Odoo Community Association (OCA)',
- 'maintainers': ['ernestotejeda'],
- 'license': 'AGPL-3',
- 'depends': [
- 'product_pack',
- 'stock',
- ],
- 'installable': True,
- 'auto_install': True,
- 'application': False,
+ "name": "Stock product Pack",
+ "version": "12.0.1.0.1",
+ "category": "Warehouse",
+ "summary": "This module allows you to get the right available quantities "
+ "of the packs",
+ "website": "https://github.com/OCA/product-pack",
+ "author": "NaN·tic, " "ADHOC SA, " "Tecnativa, " "Odoo Community Association (OCA)",
+ "maintainers": ["ernestotejeda"],
+ "license": "AGPL-3",
+ "depends": ["product_pack", "stock",],
+ "installable": True,
+ "auto_install": True,
+ "application": False,
}
diff --git a/stock_product_pack/models/product_product.py b/stock_product_pack/models/product_product.py
index 78b0f9467..c7fc541d9 100644
--- a/stock_product_pack/models/product_product.py
+++ b/stock_product_pack/models/product_product.py
@@ -1,39 +1,45 @@
# Copyright 2019 Tecnativa - Ernesto Tejeda
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-from odoo import models
import math
+from odoo import models
+
class ProductProduct(models.Model):
- _inherit = 'product.product'
+ _inherit = "product.product"
def _compute_quantities_dict(
- self, lot_id, owner_id, package_id,
- from_date=False, to_date=False):
+ self, lot_id, owner_id, package_id, from_date=False, to_date=False
+ ):
res = super()._compute_quantities_dict(
- lot_id, owner_id, package_id, from_date=from_date, to_date=to_date)
- packs = self.filtered('pack_ok')
+ lot_id, owner_id, package_id, from_date=from_date, to_date=to_date
+ )
+ packs = self.filtered("pack_ok")
for product in packs.with_context(prefetch_fields=False):
pack_qty_available = []
pack_virtual_available = []
subproducts = product.pack_line_ids.filtered(
- lambda p: p.product_id.type == 'product')
+ lambda p: p.product_id.type == "product"
+ )
for subproduct in subproducts:
subproduct_stock = subproduct.product_id
sub_qty = subproduct.quantity
if sub_qty:
- pack_qty_available.append(math.floor(
- subproduct_stock.qty_available / sub_qty))
- pack_virtual_available.append(math.floor(
- subproduct_stock.virtual_available / sub_qty))
+ pack_qty_available.append(
+ math.floor(subproduct_stock.qty_available / sub_qty)
+ )
+ pack_virtual_available.append(
+ math.floor(subproduct_stock.virtual_available / sub_qty)
+ )
res[product.id] = {
- 'qty_available': (
- pack_qty_available and min(pack_qty_available) or False),
- 'incoming_qty': 0,
- 'outgoing_qty': 0,
- 'virtual_available': (
- pack_virtual_available and
- min(pack_virtual_available) or False),
+ "qty_available": (
+ pack_qty_available and min(pack_qty_available) or False
+ ),
+ "incoming_qty": 0,
+ "outgoing_qty": 0,
+ "virtual_available": (
+ pack_virtual_available and min(pack_virtual_available) or False
+ ),
}
return res
diff --git a/stock_product_pack/tests/test_stock_product_pack.py b/stock_product_pack/tests/test_stock_product_pack.py
index 0211d9852..664fcd608 100644
--- a/stock_product_pack/tests/test_stock_product_pack.py
+++ b/stock_product_pack/tests/test_stock_product_pack.py
@@ -1,96 +1,131 @@
# Copyright 2019 Tecnativa - Ernesto Tejeda
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-from odoo.tests import SavepointCase
import logging
+from odoo.tests import SavepointCase
+
_logger = logging.getLogger(__name__)
class TestSaleProductPack(SavepointCase):
-
@classmethod
def setUpClass(cls):
super().setUpClass()
- category_all_id = cls.env.ref('product.product_category_all').id
- product_obj = cls.env['product.product']
- cls.pack_dc = cls.env['product.product'].create({
- 'name': 'Pack',
- 'type': 'product',
- 'pack_ok': True,
- 'pack_type': 'detailed',
- 'pack_component_price': 'detailed',
- 'categ_id': category_all_id,
- 'pack_line_ids': [
- (0, 0, {
- 'product_id': product_obj.create({
- 'name': 'Component 1',
- 'type': 'product',
- 'categ_id': category_all_id,
- }).id,
- 'quantity': 1,
- }),
- (0, 0, {
- 'product_id': product_obj.create({
- 'name': 'Component 2',
- 'type': 'product',
- 'categ_id': category_all_id,
- }).id,
- 'quantity': 1,
- }),
- (0, 0, {
- 'product_id': product_obj.create({
- 'name': 'Component 3',
- 'type': 'service',
- 'categ_id': category_all_id,
- }).id,
- 'quantity': 1,
- }),
- (0, 0, {
- 'product_id': product_obj.create({
- 'name': 'Component 4',
- 'type': 'consu',
- 'categ_id': category_all_id,
- }).id,
- 'quantity': 1,
- }),
- ]
- })
+ category_all_id = cls.env.ref("product.product_category_all").id
+ product_obj = cls.env["product.product"]
+ cls.pack_dc = cls.env["product.product"].create(
+ {
+ "name": "Pack",
+ "type": "product",
+ "pack_ok": True,
+ "pack_type": "detailed",
+ "pack_component_price": "detailed",
+ "categ_id": category_all_id,
+ "pack_line_ids": [
+ (
+ 0,
+ 0,
+ {
+ "product_id": product_obj.create(
+ {
+ "name": "Component 1",
+ "type": "product",
+ "categ_id": category_all_id,
+ }
+ ).id,
+ "quantity": 1,
+ },
+ ),
+ (
+ 0,
+ 0,
+ {
+ "product_id": product_obj.create(
+ {
+ "name": "Component 2",
+ "type": "product",
+ "categ_id": category_all_id,
+ }
+ ).id,
+ "quantity": 1,
+ },
+ ),
+ (
+ 0,
+ 0,
+ {
+ "product_id": product_obj.create(
+ {
+ "name": "Component 3",
+ "type": "service",
+ "categ_id": category_all_id,
+ }
+ ).id,
+ "quantity": 1,
+ },
+ ),
+ (
+ 0,
+ 0,
+ {
+ "product_id": product_obj.create(
+ {
+ "name": "Component 4",
+ "type": "consu",
+ "categ_id": category_all_id,
+ }
+ ).id,
+ "quantity": 1,
+ },
+ ),
+ ],
+ }
+ )
def test_compute_quantities_dict(self):
- location_id = self.env.ref('stock.stock_location_suppliers').id,
- location_dest_id = self.env.ref('stock.stock_location_stock').id,
- components = self.pack_dc.pack_line_ids.mapped('product_id')
- picking = self.env['stock.picking'].create({
- 'partner_id': self.env.ref('base.res_partner_4').id,
- 'picking_type_id': self.env.ref('stock.picking_type_in').id,
- 'location_id': location_id,
- 'location_dest_id': location_dest_id,
- 'move_lines': [
- (0, 0, {
- 'name': 'incoming_move_test_01',
- 'product_id': components[0].id,
- 'product_uom_qty': 5,
- 'product_uom': components[0].uom_id.id,
- 'location_id': location_id,
- 'location_dest_id': location_dest_id,
- }),
- (0, 0, {
- 'name': 'incoming_move_test_02',
- 'product_id': components[1].id,
- 'product_uom_qty': 7,
- 'product_uom': components[1].uom_id.id,
- 'location_id': location_id,
- 'location_dest_id': location_dest_id,
- }),
- ]
- })
+ location_id = (self.env.ref("stock.stock_location_suppliers").id,)
+ location_dest_id = (self.env.ref("stock.stock_location_stock").id,)
+ components = self.pack_dc.pack_line_ids.mapped("product_id")
+ picking = self.env["stock.picking"].create(
+ {
+ "partner_id": self.env.ref("base.res_partner_4").id,
+ "picking_type_id": self.env.ref("stock.picking_type_in").id,
+ "location_id": location_id,
+ "location_dest_id": location_dest_id,
+ "move_lines": [
+ (
+ 0,
+ 0,
+ {
+ "name": "incoming_move_test_01",
+ "product_id": components[0].id,
+ "product_uom_qty": 5,
+ "product_uom": components[0].uom_id.id,
+ "location_id": location_id,
+ "location_dest_id": location_dest_id,
+ },
+ ),
+ (
+ 0,
+ 0,
+ {
+ "name": "incoming_move_test_02",
+ "product_id": components[1].id,
+ "product_uom_qty": 7,
+ "product_uom": components[1].uom_id.id,
+ "location_id": location_id,
+ "location_dest_id": location_dest_id,
+ },
+ ),
+ ],
+ }
+ )
picking.action_confirm()
self.assertEqual(self.pack_dc.virtual_available, 5)
self.assertEqual(self.pack_dc.qty_available, 0)
wizard_dict = picking.button_validate()
- wizard = self.env[wizard_dict['res_model']].browse(
- wizard_dict['res_id'])
+ wizard = self.env[wizard_dict["res_model"]].browse(wizard_dict["res_id"])
wizard.process()
self.assertEqual(self.pack_dc.virtual_available, 5)
self.assertEqual(self.pack_dc.qty_available, 5)
From 16f732ebf8c5699b81b3971acafff1ee16711723 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jo=C3=A3o=20Marques?=
Date: Mon, 21 Sep 2020 15:08:42 +0200
Subject: [PATCH 10/31] [MIG] stock_product_pack: Migration to 13.0
---
stock_product_pack/README.rst | 11 +--
stock_product_pack/__manifest__.py | 5 +-
.../i18n/stock_product_pack.pot | 7 +-
stock_product_pack/models/product_product.py | 12 ++-
stock_product_pack/readme/CONTRIBUTORS.rst | 1 +
.../static/description/index.html | 7 +-
.../tests/test_stock_product_pack.py | 76 +++++--------------
7 files changed, 43 insertions(+), 76 deletions(-)
diff --git a/stock_product_pack/README.rst b/stock_product_pack/README.rst
index 4624f0a10..e1cd4e42d 100644
--- a/stock_product_pack/README.rst
+++ b/stock_product_pack/README.rst
@@ -14,13 +14,13 @@ Stock product Pack
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproduct--pack-lightgray.png?logo=github
- :target: https://github.com/OCA/product-pack/tree/12.0/stock_product_pack
+ :target: https://github.com/OCA/product-pack/tree/13.0/stock_product_pack
:alt: OCA/product-pack
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
- :target: https://translation.odoo-community.org/projects/product-pack-12-0/product-pack-12-0-stock_product_pack
+ :target: https://translation.odoo-community.org/projects/product-pack-13-0/product-pack-13-0-stock_product_pack
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
- :target: https://runbot.odoo-community.org/runbot/286/12.0
+ :target: https://runbot.odoo-community.org/runbot/286/13.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -54,7 +54,7 @@ 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 `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -76,6 +76,7 @@ Contributors
* Ernesto Tejeda
* Pedro M. Baeza
* Sergio Teruel
+ * João Marques
Maintainers
~~~~~~~~~~~
@@ -98,6 +99,6 @@ Current `maintainer `__:
|maintainer-ernestotejeda|
-This module is part of the `OCA/product-pack `_ project on GitHub.
+This module is part of the `OCA/product-pack `_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/stock_product_pack/__manifest__.py b/stock_product_pack/__manifest__.py
index e3ce18c7e..01c9b835f 100644
--- a/stock_product_pack/__manifest__.py
+++ b/stock_product_pack/__manifest__.py
@@ -1,9 +1,10 @@
# Copyright 2019 NaN (http://www.nan-tic.com) - Àngel Àlvarez
# Copyright 2019 Tecnativa - Ernesto Tejeda
+# Copyright 2020 Tecnativa - João Marques
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Stock product Pack",
- "version": "12.0.1.0.1",
+ "version": "13.0.1.0.0",
"category": "Warehouse",
"summary": "This module allows you to get the right available quantities "
"of the packs",
@@ -11,7 +12,7 @@
"author": "NaN·tic, " "ADHOC SA, " "Tecnativa, " "Odoo Community Association (OCA)",
"maintainers": ["ernestotejeda"],
"license": "AGPL-3",
- "depends": ["product_pack", "stock",],
+ "depends": ["product_pack", "stock"],
"installable": True,
"auto_install": True,
"application": False,
diff --git a/stock_product_pack/i18n/stock_product_pack.pot b/stock_product_pack/i18n/stock_product_pack.pot
index 9a5bc0927..06129d7bd 100644
--- a/stock_product_pack/i18n/stock_product_pack.pot
+++ b/stock_product_pack/i18n/stock_product_pack.pot
@@ -1,12 +1,12 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
-# * stock_product_pack
+# * stock_product_pack
#
msgid ""
msgstr ""
-"Project-Id-Version: Odoo Server 12.0\n"
+"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
-"Last-Translator: <>\n"
+"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -17,4 +17,3 @@ msgstr ""
#: model:ir.model,name:stock_product_pack.model_product_product
msgid "Product"
msgstr ""
-
diff --git a/stock_product_pack/models/product_product.py b/stock_product_pack/models/product_product.py
index c7fc541d9..8f35c6c1b 100644
--- a/stock_product_pack/models/product_product.py
+++ b/stock_product_pack/models/product_product.py
@@ -1,4 +1,5 @@
# Copyright 2019 Tecnativa - Ernesto Tejeda
+# Copyright 2020 Tecnativa - João Marques
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import math
@@ -19,6 +20,7 @@ def _compute_quantities_dict(
for product in packs.with_context(prefetch_fields=False):
pack_qty_available = []
pack_virtual_available = []
+ pack_free_qty = []
subproducts = product.pack_line_ids.filtered(
lambda p: p.product_id.type == "product"
)
@@ -32,14 +34,16 @@ def _compute_quantities_dict(
pack_virtual_available.append(
math.floor(subproduct_stock.virtual_available / sub_qty)
)
+ pack_free_qty.append(
+ math.floor(subproduct_stock.free_qty / sub_qty)
+ )
res[product.id] = {
- "qty_available": (
- pack_qty_available and min(pack_qty_available) or False
- ),
+ "qty_available": (pack_qty_available and min(pack_qty_available) or 0),
+ "free_qty": (pack_free_qty and min(pack_free_qty) or 0),
"incoming_qty": 0,
"outgoing_qty": 0,
"virtual_available": (
- pack_virtual_available and min(pack_virtual_available) or False
+ pack_virtual_available and min(pack_virtual_available) or 0
),
}
return res
diff --git a/stock_product_pack/readme/CONTRIBUTORS.rst b/stock_product_pack/readme/CONTRIBUTORS.rst
index 0c7110256..7f0f6bd5d 100644
--- a/stock_product_pack/readme/CONTRIBUTORS.rst
+++ b/stock_product_pack/readme/CONTRIBUTORS.rst
@@ -3,3 +3,4 @@
* Ernesto Tejeda
* Pedro M. Baeza
* Sergio Teruel
+ * João Marques
diff --git a/stock_product_pack/static/description/index.html b/stock_product_pack/static/description/index.html
index 5af35443f..adb0db838 100644
--- a/stock_product_pack/static/description/index.html
+++ b/stock_product_pack/static/description/index.html
@@ -367,7 +367,7 @@ Stock product Pack
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-

+

This module allows you to get On Hand and Forecasted values calculated from
components of the pack.
Table of contents
@@ -403,7 +403,7 @@
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.
+feedback.
Do not contact contributors directly about support or help with technical issues.
diff --git a/stock_product_pack/tests/test_stock_product_pack.py b/stock_product_pack/tests/test_stock_product_pack.py
index 664fcd608..5dad44b49 100644
--- a/stock_product_pack/tests/test_stock_product_pack.py
+++ b/stock_product_pack/tests/test_stock_product_pack.py
@@ -1,4 +1,5 @@
# Copyright 2019 Tecnativa - Ernesto Tejeda
+# Copyright 2020 Tecnativa - João Marques
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import logging
@@ -13,8 +14,18 @@ class TestSaleProductPack(SavepointCase):
def setUpClass(cls):
super().setUpClass()
category_all_id = cls.env.ref("product.product_category_all").id
- product_obj = cls.env["product.product"]
- cls.pack_dc = cls.env["product.product"].create(
+ cls.product_obj = cls.env["product.product"]
+ component_1 = cls.product_obj.create(
+ {"name": "Component 1", "type": "product", "categ_id": category_all_id}
+ )
+ component_2 = component_1.with_context({}).copy({"name": "Component 2"})
+ component_3 = component_1.with_context({}).copy(
+ {"name": "Component 3", "type": "service"}
+ )
+ component_4 = component_1.with_context({}).copy(
+ {"name": "Component 4", "type": "consu"}
+ )
+ cls.pack_dc = cls.product_obj.create(
{
"name": "Pack",
"type": "product",
@@ -23,62 +34,10 @@ def setUpClass(cls):
"pack_component_price": "detailed",
"categ_id": category_all_id,
"pack_line_ids": [
- (
- 0,
- 0,
- {
- "product_id": product_obj.create(
- {
- "name": "Component 1",
- "type": "product",
- "categ_id": category_all_id,
- }
- ).id,
- "quantity": 1,
- },
- ),
- (
- 0,
- 0,
- {
- "product_id": product_obj.create(
- {
- "name": "Component 2",
- "type": "product",
- "categ_id": category_all_id,
- }
- ).id,
- "quantity": 1,
- },
- ),
- (
- 0,
- 0,
- {
- "product_id": product_obj.create(
- {
- "name": "Component 3",
- "type": "service",
- "categ_id": category_all_id,
- }
- ).id,
- "quantity": 1,
- },
- ),
- (
- 0,
- 0,
- {
- "product_id": product_obj.create(
- {
- "name": "Component 4",
- "type": "consu",
- "categ_id": category_all_id,
- }
- ).id,
- "quantity": 1,
- },
- ),
+ (0, 0, {"product_id": component_1.id, "quantity": 1},),
+ (0, 0, {"product_id": component_2.id, "quantity": 1},),
+ (0, 0, {"product_id": component_3.id, "quantity": 1},),
+ (0, 0, {"product_id": component_4.id, "quantity": 1},),
],
}
)
@@ -127,5 +86,6 @@ def test_compute_quantities_dict(self):
wizard_dict = picking.button_validate()
wizard = self.env[wizard_dict["res_model"]].browse(wizard_dict["res_id"])
wizard.process()
+ self.product_obj.invalidate_cache()
self.assertEqual(self.pack_dc.virtual_available, 5)
self.assertEqual(self.pack_dc.qty_available, 5)
From 6cc8c966ae77ca368ab1e52d94905a76c11bc8fa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicol=C3=A1s=20Mac=20Rouillon?=
Date: Tue, 2 Feb 2021 15:04:55 -0300
Subject: [PATCH 11/31] [IMP] stock_product_pack: Be able for stock manager to
modify packs lines.
It seems to me that it would be if a user has the maximum stock permission, can edit the lines of packs, as well as a maximum sales permission.
---
stock_product_pack/__manifest__.py | 3 ++-
stock_product_pack/security/ir.model.access.csv | 2 ++
2 files changed, 4 insertions(+), 1 deletion(-)
create mode 100644 stock_product_pack/security/ir.model.access.csv
diff --git a/stock_product_pack/__manifest__.py b/stock_product_pack/__manifest__.py
index 01c9b835f..5960045e7 100644
--- a/stock_product_pack/__manifest__.py
+++ b/stock_product_pack/__manifest__.py
@@ -4,7 +4,7 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Stock product Pack",
- "version": "13.0.1.0.0",
+ "version": "13.0.1.1.0",
"category": "Warehouse",
"summary": "This module allows you to get the right available quantities "
"of the packs",
@@ -13,6 +13,7 @@
"maintainers": ["ernestotejeda"],
"license": "AGPL-3",
"depends": ["product_pack", "stock"],
+ "data": ["security/ir.model.access.csv"],
"installable": True,
"auto_install": True,
"application": False,
diff --git a/stock_product_pack/security/ir.model.access.csv b/stock_product_pack/security/ir.model.access.csv
new file mode 100644
index 000000000..124c24182
--- /dev/null
+++ b/stock_product_pack/security/ir.model.access.csv
@@ -0,0 +1,2 @@
+id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
+access_product_pack_line_stock_manager,product.pack.line,product_pack.model_product_pack_line,stock.group_stock_manager,1,1,1,1
From bbb53d67d26730e12afb9315b5e4f067ef5192c5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicol=C3=A1s=20Mac=20Rouillon?=
Date: Mon, 12 Apr 2021 08:51:10 -0300
Subject: [PATCH 12/31] [13.0] [IMP] stock_product_pack: Not add the product
pack to the moves if the product is storable.
---
stock_product_pack/__manifest__.py | 4 +-
.../i18n/stock_product_pack.pot | 26 ++++++++
stock_product_pack/models/__init__.py | 3 +-
stock_product_pack/models/product_template.py | 16 +++++
stock_product_pack/models/stock_rule.py | 23 +++++++
.../tests/test_stock_product_pack.py | 62 +++++++++++++++++++
.../views/product_template_views.xml | 19 ++++++
7 files changed, 150 insertions(+), 3 deletions(-)
create mode 100644 stock_product_pack/models/product_template.py
create mode 100644 stock_product_pack/models/stock_rule.py
create mode 100644 stock_product_pack/views/product_template_views.xml
diff --git a/stock_product_pack/__manifest__.py b/stock_product_pack/__manifest__.py
index 5960045e7..45132ca25 100644
--- a/stock_product_pack/__manifest__.py
+++ b/stock_product_pack/__manifest__.py
@@ -4,7 +4,7 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Stock product Pack",
- "version": "13.0.1.1.0",
+ "version": "13.0.1.2.0",
"category": "Warehouse",
"summary": "This module allows you to get the right available quantities "
"of the packs",
@@ -13,7 +13,7 @@
"maintainers": ["ernestotejeda"],
"license": "AGPL-3",
"depends": ["product_pack", "stock"],
- "data": ["security/ir.model.access.csv"],
+ "data": ["security/ir.model.access.csv", "views/product_template_views.xml"],
"installable": True,
"auto_install": True,
"application": False,
diff --git a/stock_product_pack/i18n/stock_product_pack.pot b/stock_product_pack/i18n/stock_product_pack.pot
index 06129d7bd..ae7e6c9cd 100644
--- a/stock_product_pack/i18n/stock_product_pack.pot
+++ b/stock_product_pack/i18n/stock_product_pack.pot
@@ -13,7 +13,33 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
+#. module: stock_product_pack
+#: model:ir.model.fields,field_description:stock_product_pack.field_product_product__dont_create_move
+#: model:ir.model.fields,field_description:stock_product_pack.field_product_template__dont_create_move
+msgid "Don't create move"
+msgstr ""
+
+#. module: stock_product_pack
+#: model:ir.model,name:stock_product_pack.model_procurement_group
+msgid "Procurement Group"
+msgstr ""
+
#. module: stock_product_pack
#: model:ir.model,name:stock_product_pack.model_product_product
msgid "Product"
msgstr ""
+
+#. module: stock_product_pack
+#: model:ir.model,name:stock_product_pack.model_product_template
+msgid "Product Template"
+msgstr ""
+
+#. module: stock_product_pack
+#: model:ir.model.fields,help:stock_product_pack.field_product_product__dont_create_move
+#: model:ir.model.fields,help:stock_product_pack.field_product_template__dont_create_move
+msgid ""
+"With this option, the pack won't create an stock.move and will be set as "
+"delivered upon sale confirmation. This is useful to use get pack stock "
+"availability (type = 'product') but without actually having stock and moves "
+"of it."
+msgstr ""
diff --git a/stock_product_pack/models/__init__.py b/stock_product_pack/models/__init__.py
index 586a7eff4..0637be5c0 100644
--- a/stock_product_pack/models/__init__.py
+++ b/stock_product_pack/models/__init__.py
@@ -1,3 +1,4 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-
+from . import product_template
from . import product_product
+from . import stock_rule
diff --git a/stock_product_pack/models/product_template.py b/stock_product_pack/models/product_template.py
new file mode 100644
index 000000000..04aba34ff
--- /dev/null
+++ b/stock_product_pack/models/product_template.py
@@ -0,0 +1,16 @@
+# Copyright 2019 Tecnativa - Ernesto Tejeda
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+
+from odoo import fields, models
+
+
+class ProductTemplate(models.Model):
+ _inherit = "product.template"
+
+ dont_create_move = fields.Boolean(
+ string="Don't create move",
+ help="With this option, the pack won't create an stock.move and will"
+ " be set as delivered upon sale confirmation. This is useful to use "
+ "get pack stock availability (type = 'product') but"
+ " without actually having stock and moves of it.",
+ )
diff --git a/stock_product_pack/models/stock_rule.py b/stock_product_pack/models/stock_rule.py
new file mode 100644
index 000000000..1cba587be
--- /dev/null
+++ b/stock_product_pack/models/stock_rule.py
@@ -0,0 +1,23 @@
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+
+from odoo import api, models
+
+
+class ProcurementGroup(models.Model):
+ _inherit = "procurement.group"
+
+ @api.model
+ def run(self, procurements):
+ """ If 'run' is called on a pack product storable.
+ we remove the procurement with this product pack.
+ """
+ for procurement in procurements:
+ if (
+ procurement.product_id
+ and procurement.product_id.pack_ok
+ and procurement.product_id.dont_create_move
+ and procurement.product_id.pack_type == "detailed"
+ ):
+ procurements.remove(procurement)
+
+ return super().run(procurements)
diff --git a/stock_product_pack/tests/test_stock_product_pack.py b/stock_product_pack/tests/test_stock_product_pack.py
index 5dad44b49..a8abe3506 100644
--- a/stock_product_pack/tests/test_stock_product_pack.py
+++ b/stock_product_pack/tests/test_stock_product_pack.py
@@ -15,6 +15,7 @@ def setUpClass(cls):
super().setUpClass()
category_all_id = cls.env.ref("product.product_category_all").id
cls.product_obj = cls.env["product.product"]
+ cls.stock_rule_obj = cls.env["stock.rule"]
component_1 = cls.product_obj.create(
{"name": "Component 1", "type": "product", "categ_id": category_all_id}
)
@@ -41,6 +42,37 @@ def setUpClass(cls):
],
}
)
+ warehouse = cls.env["stock.warehouse"].search(
+ [("company_id", "=", cls.env.user.id)], limit=1
+ )
+ cls.stock_rule = cls.stock_rule_obj.create(
+ {
+ "name": "Stock to Costumers",
+ "action": "pull",
+ "picking_type_id": cls.env.ref("stock.picking_type_internal").id,
+ "route_id": cls.env.ref("stock.route_warehouse0_mto").id,
+ "procure_method": "make_to_stock",
+ "warehouse_id": warehouse.id,
+ "location_id": cls.env.ref("stock.stock_location_stock").id,
+ }
+ )
+ cls.pack_dc_with_dm = cls.product_obj.create(
+ {
+ "name": "Pack With storeable and not move product",
+ "type": "product",
+ "pack_ok": True,
+ "dont_create_move": True,
+ "pack_type": "detailed",
+ "pack_component_price": "detailed",
+ "categ_id": category_all_id,
+ "pack_line_ids": [
+ (0, 0, {"product_id": component_1.id, "quantity": 1},),
+ (0, 0, {"product_id": component_2.id, "quantity": 1},),
+ (0, 0, {"product_id": component_3.id, "quantity": 1},),
+ (0, 0, {"product_id": component_4.id, "quantity": 1},),
+ ],
+ }
+ )
def test_compute_quantities_dict(self):
location_id = (self.env.ref("stock.stock_location_suppliers").id,)
@@ -89,3 +121,33 @@ def test_compute_quantities_dict(self):
self.product_obj.invalidate_cache()
self.assertEqual(self.pack_dc.virtual_available, 5)
self.assertEqual(self.pack_dc.qty_available, 5)
+
+ def test_pack_with_dont_move_the_parent(self):
+ """ Run a procurement for prod pack products when there are only 5 in stock then
+ check that MTO is applied on the moves when the rule is set to 'mts_else_mto'
+ """
+
+ def create_orderpoint(product, qty_min, qty_max, location, group):
+ return self.env["stock.warehouse.orderpoint"].create(
+ {
+ "name": "OP/%s" % product.name,
+ "product_id": product.id,
+ "product_min_qty": qty_min,
+ "product_max_qty": qty_max,
+ "location_id": location.id,
+ "group_id": group.id,
+ }
+ )
+
+ pg = self.env["procurement.group"].create({"name": "Test-product Pack"})
+ create_orderpoint(
+ self.pack_dc_with_dm,
+ 10,
+ 155,
+ self.env.ref("stock.stock_location_stock"),
+ pg,
+ )
+ self.env["stock.scheduler.compute"].create({}).procure_calculation()
+ picking_ids = self.env["stock.picking"].search([("group_id", "=", pg.id)])
+ # we need to ensure that only the compents of the packs are in the moves.
+ self.assertFalse(self.pack_dc_with_dm in picking_ids.move_lines.product_id)
diff --git a/stock_product_pack/views/product_template_views.xml b/stock_product_pack/views/product_template_views.xml
new file mode 100644
index 000000000..180232011
--- /dev/null
+++ b/stock_product_pack/views/product_template_views.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+ product.template.pack.form
+ product.template
+
+
+
+
+
+
+
+
From a1683da3bf113aa744f2aa1c58138b9dcbb1b870 Mon Sep 17 00:00:00 2001
From: OCA Transbot
Date: Fri, 30 Jul 2021 13:35:48 +0000
Subject: [PATCH 13/31] Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
Translation: product-pack-13.0/product-pack-13.0-stock_product_pack
Translate-URL: https://translation.odoo-community.org/projects/product-pack-13-0/product-pack-13-0-stock_product_pack/
---
stock_product_pack/i18n/es.po | 26 ++++++++++++++++++++++++++
stock_product_pack/i18n/fr.po | 28 +++++++++++++++++++++++++++-
stock_product_pack/i18n/pt.po | 28 +++++++++++++++++++++++++++-
3 files changed, 80 insertions(+), 2 deletions(-)
diff --git a/stock_product_pack/i18n/es.po b/stock_product_pack/i18n/es.po
index 9be1296dc..05493f240 100644
--- a/stock_product_pack/i18n/es.po
+++ b/stock_product_pack/i18n/es.po
@@ -16,7 +16,33 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
+#. module: stock_product_pack
+#: model:ir.model.fields,field_description:stock_product_pack.field_product_product__dont_create_move
+#: model:ir.model.fields,field_description:stock_product_pack.field_product_template__dont_create_move
+msgid "Don't create move"
+msgstr ""
+
+#. module: stock_product_pack
+#: model:ir.model,name:stock_product_pack.model_procurement_group
+msgid "Procurement Group"
+msgstr ""
+
#. module: stock_product_pack
#: model:ir.model,name:stock_product_pack.model_product_product
msgid "Product"
msgstr "Producto"
+
+#. module: stock_product_pack
+#: model:ir.model,name:stock_product_pack.model_product_template
+msgid "Product Template"
+msgstr ""
+
+#. module: stock_product_pack
+#: model:ir.model.fields,help:stock_product_pack.field_product_product__dont_create_move
+#: model:ir.model.fields,help:stock_product_pack.field_product_template__dont_create_move
+msgid ""
+"With this option, the pack won't create an stock.move and will be set as "
+"delivered upon sale confirmation. This is useful to use get pack stock "
+"availability (type = 'product') but without actually having stock and moves "
+"of it."
+msgstr ""
diff --git a/stock_product_pack/i18n/fr.po b/stock_product_pack/i18n/fr.po
index 4e06b0c76..bde733ab6 100644
--- a/stock_product_pack/i18n/fr.po
+++ b/stock_product_pack/i18n/fr.po
@@ -1,6 +1,6 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
-# * stock_product_pack
+# * stock_product_pack
#
msgid ""
msgstr ""
@@ -16,7 +16,33 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=n > 1;\n"
"X-Generator: Weblate 3.10\n"
+#. module: stock_product_pack
+#: model:ir.model.fields,field_description:stock_product_pack.field_product_product__dont_create_move
+#: model:ir.model.fields,field_description:stock_product_pack.field_product_template__dont_create_move
+msgid "Don't create move"
+msgstr ""
+
+#. module: stock_product_pack
+#: model:ir.model,name:stock_product_pack.model_procurement_group
+msgid "Procurement Group"
+msgstr ""
+
#. module: stock_product_pack
#: model:ir.model,name:stock_product_pack.model_product_product
msgid "Product"
msgstr "Article"
+
+#. module: stock_product_pack
+#: model:ir.model,name:stock_product_pack.model_product_template
+msgid "Product Template"
+msgstr ""
+
+#. module: stock_product_pack
+#: model:ir.model.fields,help:stock_product_pack.field_product_product__dont_create_move
+#: model:ir.model.fields,help:stock_product_pack.field_product_template__dont_create_move
+msgid ""
+"With this option, the pack won't create an stock.move and will be set as "
+"delivered upon sale confirmation. This is useful to use get pack stock "
+"availability (type = 'product') but without actually having stock and moves "
+"of it."
+msgstr ""
diff --git a/stock_product_pack/i18n/pt.po b/stock_product_pack/i18n/pt.po
index 99ce2bd80..6188b3e78 100644
--- a/stock_product_pack/i18n/pt.po
+++ b/stock_product_pack/i18n/pt.po
@@ -1,6 +1,6 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
-# * stock_product_pack
+# * stock_product_pack
#
msgid ""
msgstr ""
@@ -16,7 +16,33 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=n > 1;\n"
"X-Generator: Weblate 3.9.1\n"
+#. module: stock_product_pack
+#: model:ir.model.fields,field_description:stock_product_pack.field_product_product__dont_create_move
+#: model:ir.model.fields,field_description:stock_product_pack.field_product_template__dont_create_move
+msgid "Don't create move"
+msgstr ""
+
+#. module: stock_product_pack
+#: model:ir.model,name:stock_product_pack.model_procurement_group
+msgid "Procurement Group"
+msgstr ""
+
#. module: stock_product_pack
#: model:ir.model,name:stock_product_pack.model_product_product
msgid "Product"
msgstr "Produto"
+
+#. module: stock_product_pack
+#: model:ir.model,name:stock_product_pack.model_product_template
+msgid "Product Template"
+msgstr ""
+
+#. module: stock_product_pack
+#: model:ir.model.fields,help:stock_product_pack.field_product_product__dont_create_move
+#: model:ir.model.fields,help:stock_product_pack.field_product_template__dont_create_move
+msgid ""
+"With this option, the pack won't create an stock.move and will be set as "
+"delivered upon sale confirmation. This is useful to use get pack stock "
+"availability (type = 'product') but without actually having stock and moves "
+"of it."
+msgstr ""
From 4cc2c8b768ab292f3b19558631780becf095dbfb Mon Sep 17 00:00:00 2001
From: Usdoo Wedoo
Date: Sat, 18 Sep 2021 12:12:44 -0500
Subject: [PATCH 14/31] [14.0][MIG] stock_product_pack: Migration to 14.0
---
stock_product_pack/README.rst | 10 ++--
stock_product_pack/__manifest__.py | 3 +-
.../i18n/stock_product_pack.pot | 23 +++++++-
stock_product_pack/models/stock_rule.py | 8 +--
.../static/description/index.html | 6 +-
.../tests/test_stock_product_pack.py | 59 +++++++++++++++----
6 files changed, 84 insertions(+), 25 deletions(-)
diff --git a/stock_product_pack/README.rst b/stock_product_pack/README.rst
index e1cd4e42d..34157850c 100644
--- a/stock_product_pack/README.rst
+++ b/stock_product_pack/README.rst
@@ -14,13 +14,13 @@ Stock product Pack
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproduct--pack-lightgray.png?logo=github
- :target: https://github.com/OCA/product-pack/tree/13.0/stock_product_pack
+ :target: https://github.com/OCA/product-pack/tree/14.0/stock_product_pack
:alt: OCA/product-pack
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
- :target: https://translation.odoo-community.org/projects/product-pack-13-0/product-pack-13-0-stock_product_pack
+ :target: https://translation.odoo-community.org/projects/product-pack-14-0/product-pack-14-0-stock_product_pack
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
- :target: https://runbot.odoo-community.org/runbot/286/13.0
+ :target: https://runbot.odoo-community.org/runbot/286/14.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -54,7 +54,7 @@ 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 `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -99,6 +99,6 @@ Current `maintainer `__:
|maintainer-ernestotejeda|
-This module is part of the `OCA/product-pack `_ project on GitHub.
+This module is part of the `OCA/product-pack `_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/stock_product_pack/__manifest__.py b/stock_product_pack/__manifest__.py
index 45132ca25..16d0ba55f 100644
--- a/stock_product_pack/__manifest__.py
+++ b/stock_product_pack/__manifest__.py
@@ -1,10 +1,11 @@
+# Copyright 2021 Julio Cesar Bravo Rodriguez
# Copyright 2019 NaN (http://www.nan-tic.com) - Àngel Àlvarez
# Copyright 2019 Tecnativa - Ernesto Tejeda
# Copyright 2020 Tecnativa - João Marques
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Stock product Pack",
- "version": "13.0.1.2.0",
+ "version": "14.0.1.0.0",
"category": "Warehouse",
"summary": "This module allows you to get the right available quantities "
"of the packs",
diff --git a/stock_product_pack/i18n/stock_product_pack.pot b/stock_product_pack/i18n/stock_product_pack.pot
index ae7e6c9cd..49cbe0314 100644
--- a/stock_product_pack/i18n/stock_product_pack.pot
+++ b/stock_product_pack/i18n/stock_product_pack.pot
@@ -4,7 +4,7 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: Odoo Server 13.0\n"
+"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
@@ -13,12 +13,33 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
+#. module: stock_product_pack
+#: model:ir.model.fields,field_description:stock_product_pack.field_procurement_group__display_name
+#: model:ir.model.fields,field_description:stock_product_pack.field_product_product__display_name
+#: model:ir.model.fields,field_description:stock_product_pack.field_product_template__display_name
+msgid "Display Name"
+msgstr ""
+
#. module: stock_product_pack
#: model:ir.model.fields,field_description:stock_product_pack.field_product_product__dont_create_move
#: model:ir.model.fields,field_description:stock_product_pack.field_product_template__dont_create_move
msgid "Don't create move"
msgstr ""
+#. module: stock_product_pack
+#: model:ir.model.fields,field_description:stock_product_pack.field_procurement_group__id
+#: model:ir.model.fields,field_description:stock_product_pack.field_product_product__id
+#: model:ir.model.fields,field_description:stock_product_pack.field_product_template__id
+msgid "ID"
+msgstr ""
+
+#. module: stock_product_pack
+#: model:ir.model.fields,field_description:stock_product_pack.field_procurement_group____last_update
+#: model:ir.model.fields,field_description:stock_product_pack.field_product_product____last_update
+#: model:ir.model.fields,field_description:stock_product_pack.field_product_template____last_update
+msgid "Last Modified on"
+msgstr ""
+
#. module: stock_product_pack
#: model:ir.model,name:stock_product_pack.model_procurement_group
msgid "Procurement Group"
diff --git a/stock_product_pack/models/stock_rule.py b/stock_product_pack/models/stock_rule.py
index 1cba587be..316977e36 100644
--- a/stock_product_pack/models/stock_rule.py
+++ b/stock_product_pack/models/stock_rule.py
@@ -7,9 +7,9 @@ class ProcurementGroup(models.Model):
_inherit = "procurement.group"
@api.model
- def run(self, procurements):
- """ If 'run' is called on a pack product storable.
- we remove the procurement with this product pack.
+ def run(self, procurements, raise_user_error=True):
+ """If 'run' is called on a pack product storable.
+ we remove the procurement with this product pack.
"""
for procurement in procurements:
if (
@@ -20,4 +20,4 @@ def run(self, procurements):
):
procurements.remove(procurement)
- return super().run(procurements)
+ return super().run(procurements, raise_user_error=raise_user_error)
diff --git a/stock_product_pack/static/description/index.html b/stock_product_pack/static/description/index.html
index adb0db838..7a4c2d88a 100644
--- a/stock_product_pack/static/description/index.html
+++ b/stock_product_pack/static/description/index.html
@@ -367,7 +367,7 @@ Stock product Pack
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-

+

This module allows you to get On Hand and Forecasted values calculated from
components of the pack.
Table of contents
@@ -403,7 +403,7 @@
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.
+feedback.
Do not contact contributors directly about support or help with technical issues.
diff --git a/stock_product_pack/tests/test_stock_product_pack.py b/stock_product_pack/tests/test_stock_product_pack.py
index a8abe3506..352a3791d 100644
--- a/stock_product_pack/tests/test_stock_product_pack.py
+++ b/stock_product_pack/tests/test_stock_product_pack.py
@@ -4,7 +4,7 @@
import logging
-from odoo.tests import SavepointCase
+from odoo.tests import Form, SavepointCase
_logger = logging.getLogger(__name__)
@@ -35,10 +35,26 @@ def setUpClass(cls):
"pack_component_price": "detailed",
"categ_id": category_all_id,
"pack_line_ids": [
- (0, 0, {"product_id": component_1.id, "quantity": 1},),
- (0, 0, {"product_id": component_2.id, "quantity": 1},),
- (0, 0, {"product_id": component_3.id, "quantity": 1},),
- (0, 0, {"product_id": component_4.id, "quantity": 1},),
+ (
+ 0,
+ 0,
+ {"product_id": component_1.id, "quantity": 1},
+ ),
+ (
+ 0,
+ 0,
+ {"product_id": component_2.id, "quantity": 1},
+ ),
+ (
+ 0,
+ 0,
+ {"product_id": component_3.id, "quantity": 1},
+ ),
+ (
+ 0,
+ 0,
+ {"product_id": component_4.id, "quantity": 1},
+ ),
],
}
)
@@ -66,10 +82,26 @@ def setUpClass(cls):
"pack_component_price": "detailed",
"categ_id": category_all_id,
"pack_line_ids": [
- (0, 0, {"product_id": component_1.id, "quantity": 1},),
- (0, 0, {"product_id": component_2.id, "quantity": 1},),
- (0, 0, {"product_id": component_3.id, "quantity": 1},),
- (0, 0, {"product_id": component_4.id, "quantity": 1},),
+ (
+ 0,
+ 0,
+ {"product_id": component_1.id, "quantity": 1},
+ ),
+ (
+ 0,
+ 0,
+ {"product_id": component_2.id, "quantity": 1},
+ ),
+ (
+ 0,
+ 0,
+ {"product_id": component_3.id, "quantity": 1},
+ ),
+ (
+ 0,
+ 0,
+ {"product_id": component_4.id, "quantity": 1},
+ ),
],
}
)
@@ -78,6 +110,7 @@ def test_compute_quantities_dict(self):
location_id = (self.env.ref("stock.stock_location_suppliers").id,)
location_dest_id = (self.env.ref("stock.stock_location_stock").id,)
components = self.pack_dc.pack_line_ids.mapped("product_id")
+
picking = self.env["stock.picking"].create(
{
"partner_id": self.env.ref("base.res_partner_4").id,
@@ -116,14 +149,18 @@ def test_compute_quantities_dict(self):
self.assertEqual(self.pack_dc.virtual_available, 5)
self.assertEqual(self.pack_dc.qty_available, 0)
wizard_dict = picking.button_validate()
- wizard = self.env[wizard_dict["res_model"]].browse(wizard_dict["res_id"])
+ wizard = Form(
+ self.env[(wizard_dict.get("res_model"))].with_context(
+ wizard_dict["context"]
+ )
+ ).save()
wizard.process()
self.product_obj.invalidate_cache()
self.assertEqual(self.pack_dc.virtual_available, 5)
self.assertEqual(self.pack_dc.qty_available, 5)
def test_pack_with_dont_move_the_parent(self):
- """ Run a procurement for prod pack products when there are only 5 in stock then
+ """Run a procurement for prod pack products when there are only 5 in stock then
check that MTO is applied on the moves when the rule is set to 'mts_else_mto'
"""
From d625a468cafd31ab7373650fe98599f335f3fc4c Mon Sep 17 00:00:00 2001
From: "Bruno Zanotti (ADHOC)"
Date: Thu, 22 Apr 2021 13:37:22 -0300
Subject: [PATCH 15/31] [FIX] stock_product_pack: stock on services packs
In v13 Odoo sets the stock at zero for products that are not services.
This commit will keep the stock of the services if they are packs,
to remain the functionality of the lasts versions.
---
stock_product_pack/__manifest__.py | 2 +-
stock_product_pack/models/product_product.py | 23 ++++++++++++++++++++
2 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/stock_product_pack/__manifest__.py b/stock_product_pack/__manifest__.py
index 16d0ba55f..f2ba5aa97 100644
--- a/stock_product_pack/__manifest__.py
+++ b/stock_product_pack/__manifest__.py
@@ -5,7 +5,7 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Stock product Pack",
- "version": "14.0.1.0.0",
+ "version": "14.0.1.0.1",
"category": "Warehouse",
"summary": "This module allows you to get the right available quantities "
"of the packs",
diff --git a/stock_product_pack/models/product_product.py b/stock_product_pack/models/product_product.py
index 8f35c6c1b..5ec3d375d 100644
--- a/stock_product_pack/models/product_product.py
+++ b/stock_product_pack/models/product_product.py
@@ -47,3 +47,26 @@ def _compute_quantities_dict(
),
}
return res
+
+ def _compute_quantities(self):
+ """ In v13 Odoo introduces a filter for products not services.
+ To keep how it was working on v12 we try to get stock for
+ service products if they are pack.
+ """
+ service_pack_products = self.filtered(
+ lambda p: p.type == "service" and p.pack_ok
+ )
+ super(ProductProduct, self - service_pack_products)._compute_quantities()
+ res = service_pack_products._compute_quantities_dict(
+ self._context.get("lot_id"),
+ self._context.get("owner_id"),
+ self._context.get("package_id"),
+ self._context.get("from_date"),
+ self._context.get("to_date"),
+ )
+ for product in service_pack_products:
+ product.qty_available = res[product.id]["qty_available"]
+ product.incoming_qty = res[product.id]["incoming_qty"]
+ product.outgoing_qty = res[product.id]["outgoing_qty"]
+ product.virtual_available = res[product.id]["virtual_available"]
+ product.free_qty = res[product.id]["free_qty"]
From 1006e987f882b361f6943b2882bf373f1db930ac Mon Sep 17 00:00:00 2001
From: "Pedro M. Baeza"
Date: Mon, 3 Jan 2022 19:43:46 +0100
Subject: [PATCH 16/31] [FIX] stock_product_pack: pre-commit
---
stock_product_pack/models/product_product.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/stock_product_pack/models/product_product.py b/stock_product_pack/models/product_product.py
index 5ec3d375d..7c9297f27 100644
--- a/stock_product_pack/models/product_product.py
+++ b/stock_product_pack/models/product_product.py
@@ -49,7 +49,7 @@ def _compute_quantities_dict(
return res
def _compute_quantities(self):
- """ In v13 Odoo introduces a filter for products not services.
+ """In v13 Odoo introduces a filter for products not services.
To keep how it was working on v12 we try to get stock for
service products if they are pack.
"""
From f660f20e2763b049622f85150db2b36eb1a4ebfe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Luis=20Ernesto=20Garc=C3=ADa=20Medina?=
Date: Wed, 1 Mar 2023 12:49:27 -0600
Subject: [PATCH 17/31] [MIG] stock_product_pack: Migration to 15.0
---
stock_product_pack/__manifest__.py | 2 +-
stock_product_pack/models/product_product.py | 9 +++--
.../tests/test_stock_product_pack.py | 40 ++++++++++++++-----
.../views/product_template_views.xml | 2 +-
4 files changed, 37 insertions(+), 16 deletions(-)
diff --git a/stock_product_pack/__manifest__.py b/stock_product_pack/__manifest__.py
index f2ba5aa97..ef2c01ca2 100644
--- a/stock_product_pack/__manifest__.py
+++ b/stock_product_pack/__manifest__.py
@@ -5,7 +5,7 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Stock product Pack",
- "version": "14.0.1.0.1",
+ "version": "15.0.1.0.0",
"category": "Warehouse",
"summary": "This module allows you to get the right available quantities "
"of the packs",
diff --git a/stock_product_pack/models/product_product.py b/stock_product_pack/models/product_product.py
index 7c9297f27..ba2989823 100644
--- a/stock_product_pack/models/product_product.py
+++ b/stock_product_pack/models/product_product.py
@@ -22,7 +22,7 @@ def _compute_quantities_dict(
pack_virtual_available = []
pack_free_qty = []
subproducts = product.pack_line_ids.filtered(
- lambda p: p.product_id.type == "product"
+ lambda p: p.product_id.detailed_type == "product"
)
for subproduct in subproducts:
subproduct_stock = subproduct.product_id
@@ -54,9 +54,11 @@ def _compute_quantities(self):
service products if they are pack.
"""
service_pack_products = self.filtered(
- lambda p: p.type == "service" and p.pack_ok
+ lambda p: p.detailed_type == "service" and p.pack_ok
)
- super(ProductProduct, self - service_pack_products)._compute_quantities()
+ result = super(
+ ProductProduct, self - service_pack_products
+ )._compute_quantities()
res = service_pack_products._compute_quantities_dict(
self._context.get("lot_id"),
self._context.get("owner_id"),
@@ -70,3 +72,4 @@ def _compute_quantities(self):
product.outgoing_qty = res[product.id]["outgoing_qty"]
product.virtual_available = res[product.id]["virtual_available"]
product.free_qty = res[product.id]["free_qty"]
+ return result
diff --git a/stock_product_pack/tests/test_stock_product_pack.py b/stock_product_pack/tests/test_stock_product_pack.py
index 352a3791d..44afca2ad 100644
--- a/stock_product_pack/tests/test_stock_product_pack.py
+++ b/stock_product_pack/tests/test_stock_product_pack.py
@@ -4,12 +4,12 @@
import logging
-from odoo.tests import Form, SavepointCase
+from odoo.tests import Form, TransactionCase
_logger = logging.getLogger(__name__)
-class TestSaleProductPack(SavepointCase):
+class TestSaleProductPack(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
@@ -17,19 +17,37 @@ def setUpClass(cls):
cls.product_obj = cls.env["product.product"]
cls.stock_rule_obj = cls.env["stock.rule"]
component_1 = cls.product_obj.create(
- {"name": "Component 1", "type": "product", "categ_id": category_all_id}
+ {
+ "name": "Component 1",
+ "detailed_type": "product",
+ "categ_id": category_all_id,
+ }
)
- component_2 = component_1.with_context({}).copy({"name": "Component 2"})
- component_3 = component_1.with_context({}).copy(
- {"name": "Component 3", "type": "service"}
+ component_2 = cls.product_obj.create(
+ {
+ "name": "Component 2",
+ "detailed_type": "product",
+ "categ_id": category_all_id,
+ }
)
- component_4 = component_1.with_context({}).copy(
- {"name": "Component 4", "type": "consu"}
+ component_3 = cls.product_obj.create(
+ {
+ "name": "Component 3",
+ "detailed_type": "service",
+ "categ_id": category_all_id,
+ }
+ )
+ component_4 = cls.product_obj.create(
+ {
+ "name": "Component 4",
+ "detailed_type": "consu",
+ "categ_id": category_all_id,
+ }
)
cls.pack_dc = cls.product_obj.create(
{
"name": "Pack",
- "type": "product",
+ "detailed_type": "product",
"pack_ok": True,
"pack_type": "detailed",
"pack_component_price": "detailed",
@@ -75,7 +93,7 @@ def setUpClass(cls):
cls.pack_dc_with_dm = cls.product_obj.create(
{
"name": "Pack With storeable and not move product",
- "type": "product",
+ "detailed_type": "product",
"pack_ok": True,
"dont_create_move": True,
"pack_type": "detailed",
@@ -151,7 +169,7 @@ def test_compute_quantities_dict(self):
wizard_dict = picking.button_validate()
wizard = Form(
self.env[(wizard_dict.get("res_model"))].with_context(
- wizard_dict["context"]
+ **wizard_dict["context"]
)
).save()
wizard.process()
diff --git a/stock_product_pack/views/product_template_views.xml b/stock_product_pack/views/product_template_views.xml
index 180232011..89c459003 100644
--- a/stock_product_pack/views/product_template_views.xml
+++ b/stock_product_pack/views/product_template_views.xml
@@ -11,7 +11,7 @@
From 5fba935eb26eed0072f68880d1f6fdc29b2a7906 Mon Sep 17 00:00:00 2001
From: oca-ci
Date: Mon, 6 Mar 2023 19:31:25 +0000
Subject: [PATCH 18/31] [UPD] Update stock_product_pack.pot
---
.../i18n/stock_product_pack.pot | 23 +------------------
1 file changed, 1 insertion(+), 22 deletions(-)
diff --git a/stock_product_pack/i18n/stock_product_pack.pot b/stock_product_pack/i18n/stock_product_pack.pot
index 49cbe0314..eb6bf43e5 100644
--- a/stock_product_pack/i18n/stock_product_pack.pot
+++ b/stock_product_pack/i18n/stock_product_pack.pot
@@ -4,7 +4,7 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: Odoo Server 14.0\n"
+"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
@@ -13,33 +13,12 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
-#. module: stock_product_pack
-#: model:ir.model.fields,field_description:stock_product_pack.field_procurement_group__display_name
-#: model:ir.model.fields,field_description:stock_product_pack.field_product_product__display_name
-#: model:ir.model.fields,field_description:stock_product_pack.field_product_template__display_name
-msgid "Display Name"
-msgstr ""
-
#. module: stock_product_pack
#: model:ir.model.fields,field_description:stock_product_pack.field_product_product__dont_create_move
#: model:ir.model.fields,field_description:stock_product_pack.field_product_template__dont_create_move
msgid "Don't create move"
msgstr ""
-#. module: stock_product_pack
-#: model:ir.model.fields,field_description:stock_product_pack.field_procurement_group__id
-#: model:ir.model.fields,field_description:stock_product_pack.field_product_product__id
-#: model:ir.model.fields,field_description:stock_product_pack.field_product_template__id
-msgid "ID"
-msgstr ""
-
-#. module: stock_product_pack
-#: model:ir.model.fields,field_description:stock_product_pack.field_procurement_group____last_update
-#: model:ir.model.fields,field_description:stock_product_pack.field_product_product____last_update
-#: model:ir.model.fields,field_description:stock_product_pack.field_product_template____last_update
-msgid "Last Modified on"
-msgstr ""
-
#. module: stock_product_pack
#: model:ir.model,name:stock_product_pack.model_procurement_group
msgid "Procurement Group"
From 069d19118ed900d965abdf582bc29f10da0a53c0 Mon Sep 17 00:00:00 2001
From: OCA-git-bot
Date: Mon, 6 Mar 2023 19:34:08 +0000
Subject: [PATCH 19/31] [UPD] README.rst
---
stock_product_pack/README.rst | 10 +++++-----
stock_product_pack/static/description/index.html | 6 +++---
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/stock_product_pack/README.rst b/stock_product_pack/README.rst
index 34157850c..8f7c3b9d2 100644
--- a/stock_product_pack/README.rst
+++ b/stock_product_pack/README.rst
@@ -14,13 +14,13 @@ Stock product Pack
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproduct--pack-lightgray.png?logo=github
- :target: https://github.com/OCA/product-pack/tree/14.0/stock_product_pack
+ :target: https://github.com/OCA/product-pack/tree/15.0/stock_product_pack
:alt: OCA/product-pack
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
- :target: https://translation.odoo-community.org/projects/product-pack-14-0/product-pack-14-0-stock_product_pack
+ :target: https://translation.odoo-community.org/projects/product-pack-15-0/product-pack-15-0-stock_product_pack
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
- :target: https://runbot.odoo-community.org/runbot/286/14.0
+ :target: https://runbot.odoo-community.org/runbot/286/15.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -54,7 +54,7 @@ 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 `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -99,6 +99,6 @@ Current `maintainer `__:
|maintainer-ernestotejeda|
-This module is part of the `OCA/product-pack `_ project on GitHub.
+This module is part of the `OCA/product-pack `_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/stock_product_pack/static/description/index.html b/stock_product_pack/static/description/index.html
index 7a4c2d88a..4e7b82228 100644
--- a/stock_product_pack/static/description/index.html
+++ b/stock_product_pack/static/description/index.html
@@ -367,7 +367,7 @@ Stock product Pack
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-

+

This module allows you to get On Hand and Forecasted values calculated from
components of the pack.
Table of contents
@@ -403,7 +403,7 @@
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.
+feedback.
Do not contact contributors directly about support or help with technical issues.
From 079f5c2a7399dc21e5e4a463b3407264abafd046 Mon Sep 17 00:00:00 2001
From: Raf Ven
Date: Thu, 23 Feb 2023 17:12:49 +0100
Subject: [PATCH 20/31] [MIG] stock_product_pack: Migration to 16.0
---
stock_product_pack/__manifest__.py | 4 ++--
stock_product_pack/tests/test_stock_product_pack.py | 7 +++----
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/stock_product_pack/__manifest__.py b/stock_product_pack/__manifest__.py
index ef2c01ca2..7ab78dc1c 100644
--- a/stock_product_pack/__manifest__.py
+++ b/stock_product_pack/__manifest__.py
@@ -5,12 +5,12 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Stock product Pack",
- "version": "15.0.1.0.0",
+ "version": "16.0.1.0.0",
"category": "Warehouse",
"summary": "This module allows you to get the right available quantities "
"of the packs",
"website": "https://github.com/OCA/product-pack",
- "author": "NaN·tic, " "ADHOC SA, " "Tecnativa, " "Odoo Community Association (OCA)",
+ "author": "NaN·tic, ADHOC SA, Tecnativa, Odoo Community Association (OCA)",
"maintainers": ["ernestotejeda"],
"license": "AGPL-3",
"depends": ["product_pack", "stock"],
diff --git a/stock_product_pack/tests/test_stock_product_pack.py b/stock_product_pack/tests/test_stock_product_pack.py
index 44afca2ad..cf789af2b 100644
--- a/stock_product_pack/tests/test_stock_product_pack.py
+++ b/stock_product_pack/tests/test_stock_product_pack.py
@@ -87,7 +87,7 @@ def setUpClass(cls):
"route_id": cls.env.ref("stock.route_warehouse0_mto").id,
"procure_method": "make_to_stock",
"warehouse_id": warehouse.id,
- "location_id": cls.env.ref("stock.stock_location_stock").id,
+ "location_dest_id": cls.env.ref("stock.stock_location_stock").id,
}
)
cls.pack_dc_with_dm = cls.product_obj.create(
@@ -135,7 +135,7 @@ def test_compute_quantities_dict(self):
"picking_type_id": self.env.ref("stock.picking_type_in").id,
"location_id": location_id,
"location_dest_id": location_dest_id,
- "move_lines": [
+ "move_ids": [
(
0,
0,
@@ -173,7 +173,6 @@ def test_compute_quantities_dict(self):
)
).save()
wizard.process()
- self.product_obj.invalidate_cache()
self.assertEqual(self.pack_dc.virtual_available, 5)
self.assertEqual(self.pack_dc.qty_available, 5)
@@ -205,4 +204,4 @@ def create_orderpoint(product, qty_min, qty_max, location, group):
self.env["stock.scheduler.compute"].create({}).procure_calculation()
picking_ids = self.env["stock.picking"].search([("group_id", "=", pg.id)])
# we need to ensure that only the compents of the packs are in the moves.
- self.assertFalse(self.pack_dc_with_dm in picking_ids.move_lines.product_id)
+ self.assertFalse(self.pack_dc_with_dm in picking_ids.move_ids.product_id)
From 9248c969bbebc2cd91a9b9624a67b67fb693bed2 Mon Sep 17 00:00:00 2001
From: oca-ci
Date: Mon, 5 Jun 2023 15:35:16 +0000
Subject: [PATCH 21/31] [UPD] Update stock_product_pack.pot
---
stock_product_pack/i18n/stock_product_pack.pot | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/stock_product_pack/i18n/stock_product_pack.pot b/stock_product_pack/i18n/stock_product_pack.pot
index eb6bf43e5..4620ff5f0 100644
--- a/stock_product_pack/i18n/stock_product_pack.pot
+++ b/stock_product_pack/i18n/stock_product_pack.pot
@@ -4,7 +4,7 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: Odoo Server 15.0\n"
+"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
@@ -25,13 +25,13 @@ msgid "Procurement Group"
msgstr ""
#. module: stock_product_pack
-#: model:ir.model,name:stock_product_pack.model_product_product
+#: model:ir.model,name:stock_product_pack.model_product_template
msgid "Product"
msgstr ""
#. module: stock_product_pack
-#: model:ir.model,name:stock_product_pack.model_product_template
-msgid "Product Template"
+#: model:ir.model,name:stock_product_pack.model_product_product
+msgid "Product Variant"
msgstr ""
#. module: stock_product_pack
From 7989e9ab38b7eb4fb9fe8a85edc8bbadc0a8afac Mon Sep 17 00:00:00 2001
From: OCA-git-bot
Date: Mon, 5 Jun 2023 15:41:03 +0000
Subject: [PATCH 22/31] [UPD] README.rst
---
stock_product_pack/README.rst | 10 +++++-----
stock_product_pack/static/description/index.html | 6 +++---
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/stock_product_pack/README.rst b/stock_product_pack/README.rst
index 8f7c3b9d2..d1163025d 100644
--- a/stock_product_pack/README.rst
+++ b/stock_product_pack/README.rst
@@ -14,13 +14,13 @@ Stock product Pack
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproduct--pack-lightgray.png?logo=github
- :target: https://github.com/OCA/product-pack/tree/15.0/stock_product_pack
+ :target: https://github.com/OCA/product-pack/tree/16.0/stock_product_pack
:alt: OCA/product-pack
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
- :target: https://translation.odoo-community.org/projects/product-pack-15-0/product-pack-15-0-stock_product_pack
+ :target: https://translation.odoo-community.org/projects/product-pack-16-0/product-pack-16-0-stock_product_pack
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
- :target: https://runbot.odoo-community.org/runbot/286/15.0
+ :target: https://runbot.odoo-community.org/runbot/286/16.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -54,7 +54,7 @@ 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 `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -99,6 +99,6 @@ Current `maintainer `__:
|maintainer-ernestotejeda|
-This module is part of the `OCA/product-pack `_ project on GitHub.
+This module is part of the `OCA/product-pack `_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/stock_product_pack/static/description/index.html b/stock_product_pack/static/description/index.html
index 4e7b82228..0fb543e27 100644
--- a/stock_product_pack/static/description/index.html
+++ b/stock_product_pack/static/description/index.html
@@ -367,7 +367,7 @@ Stock product Pack
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-

+

This module allows you to get On Hand and Forecasted values calculated from
components of the pack.
Table of contents
@@ -403,7 +403,7 @@
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.
+feedback.
Do not contact contributors directly about support or help with technical issues.
From 7f314757d6ddc978d21dc247f13d16fa88ecda13 Mon Sep 17 00:00:00 2001
From: Weblate
Date: Mon, 5 Jun 2023 19:09:02 +0000
Subject: [PATCH 23/31] Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
Translation: product-pack-16.0/product-pack-16.0-stock_product_pack
Translate-URL: https://translation.odoo-community.org/projects/product-pack-16-0/product-pack-16-0-stock_product_pack/
---
stock_product_pack/i18n/es.po | 6 +++---
stock_product_pack/i18n/fr.po | 6 +++---
stock_product_pack/i18n/pt.po | 6 +++---
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/stock_product_pack/i18n/es.po b/stock_product_pack/i18n/es.po
index 05493f240..4d56a62a2 100644
--- a/stock_product_pack/i18n/es.po
+++ b/stock_product_pack/i18n/es.po
@@ -28,13 +28,13 @@ msgid "Procurement Group"
msgstr ""
#. module: stock_product_pack
-#: model:ir.model,name:stock_product_pack.model_product_product
+#: model:ir.model,name:stock_product_pack.model_product_template
msgid "Product"
msgstr "Producto"
#. module: stock_product_pack
-#: model:ir.model,name:stock_product_pack.model_product_template
-msgid "Product Template"
+#: model:ir.model,name:stock_product_pack.model_product_product
+msgid "Product Variant"
msgstr ""
#. module: stock_product_pack
diff --git a/stock_product_pack/i18n/fr.po b/stock_product_pack/i18n/fr.po
index bde733ab6..92e6eece6 100644
--- a/stock_product_pack/i18n/fr.po
+++ b/stock_product_pack/i18n/fr.po
@@ -28,13 +28,13 @@ msgid "Procurement Group"
msgstr ""
#. module: stock_product_pack
-#: model:ir.model,name:stock_product_pack.model_product_product
+#: model:ir.model,name:stock_product_pack.model_product_template
msgid "Product"
msgstr "Article"
#. module: stock_product_pack
-#: model:ir.model,name:stock_product_pack.model_product_template
-msgid "Product Template"
+#: model:ir.model,name:stock_product_pack.model_product_product
+msgid "Product Variant"
msgstr ""
#. module: stock_product_pack
diff --git a/stock_product_pack/i18n/pt.po b/stock_product_pack/i18n/pt.po
index 6188b3e78..f6fadc0df 100644
--- a/stock_product_pack/i18n/pt.po
+++ b/stock_product_pack/i18n/pt.po
@@ -28,13 +28,13 @@ msgid "Procurement Group"
msgstr ""
#. module: stock_product_pack
-#: model:ir.model,name:stock_product_pack.model_product_product
+#: model:ir.model,name:stock_product_pack.model_product_template
msgid "Product"
msgstr "Produto"
#. module: stock_product_pack
-#: model:ir.model,name:stock_product_pack.model_product_template
-msgid "Product Template"
+#: model:ir.model,name:stock_product_pack.model_product_product
+msgid "Product Variant"
msgstr ""
#. module: stock_product_pack
From 8fe1c1bf6143aa30d33e819344cd260be57e4922 Mon Sep 17 00:00:00 2001
From: OCA-git-bot
Date: Sun, 3 Sep 2023 15:27:03 +0000
Subject: [PATCH 24/31] [UPD] README.rst
---
stock_product_pack/README.rst | 15 ++++---
.../static/description/index.html | 40 ++++++++++---------
2 files changed, 30 insertions(+), 25 deletions(-)
diff --git a/stock_product_pack/README.rst b/stock_product_pack/README.rst
index d1163025d..c0708f8df 100644
--- a/stock_product_pack/README.rst
+++ b/stock_product_pack/README.rst
@@ -2,10 +2,13 @@
Stock product Pack
==================
-.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+..
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ !! source digest: sha256:ebc372d1ed11084b43923fe380d6ec0197ee89b67458ebb1aebadc39d0a93953
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
@@ -19,11 +22,11 @@ Stock product Pack
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/product-pack-16-0/product-pack-16-0-stock_product_pack
:alt: Translate me on Weblate
-.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
- :target: https://runbot.odoo-community.org/runbot/286/16.0
- :alt: Try me on Runbot
+.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
+ :target: https://runboat.odoo-community.org/builds?repo=OCA/product-pack&target_branch=16.0
+ :alt: Try me on Runboat
-|badge1| |badge2| |badge3| |badge4| |badge5|
+|badge1| |badge2| |badge3| |badge4| |badge5|
This module allows you to get *On Hand* and *Forecasted* values calculated from
components of the pack.
@@ -53,7 +56,7 @@ 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
+If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback `_.
Do not contact contributors directly about support or help with technical issues.
diff --git a/stock_product_pack/static/description/index.html b/stock_product_pack/static/description/index.html
index 0fb543e27..e38f3566c 100644
--- a/stock_product_pack/static/description/index.html
+++ b/stock_product_pack/static/description/index.html
@@ -1,20 +1,20 @@
-
+
-
+
Stock product Pack