diff --git a/product_pack/__manifest__.py b/product_pack/__manifest__.py index dffdacfb..c83c60be 100644 --- a/product_pack/__manifest__.py +++ b/product_pack/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). { "name": "Product Pack", - "version": "17.0.2.0.0", + "version": "18.0.1.0.0", "category": "Product", "summary": "This module allows you to set a product as a Pack", "website": "https://github.com/OCA/product-pack", diff --git a/product_pack/models/product_pack_line.py b/product_pack/models/product_pack_line.py index 45e17e60..ae045625 100644 --- a/product_pack/models/product_pack_line.py +++ b/product_pack/models/product_pack_line.py @@ -75,7 +75,6 @@ def _pack_line_price_compute( # If the component is a pack for pack in packs: pack_prices[pack.id] = pack.lst_price - # else no_pack_prices = no_packs._price_compute( price_type, uom, currency, company, date diff --git a/product_pack/models/product_pricelist.py b/product_pack/models/product_pricelist.py index 8a42cf6b..6ac82113 100644 --- a/product_pack/models/product_pricelist.py +++ b/product_pack/models/product_pricelist.py @@ -4,7 +4,7 @@ class Pricelist(models.Model): _inherit = "product.pricelist" - def _get_product_price(self, product, quantity, uom=None, date=False, **kwargs): + def _get_product_price(self, product, *args, **kwargs): """Compute the pricelist price for the specified pack product, qty & uom. :returns: unit price of the pack product + components, @@ -20,32 +20,24 @@ def _get_product_price(self, product, quantity, uom=None, date=False, **kwargs): ): pack_price = 0 else: - pack_price = self._compute_price_rule( - product, quantity, uom=uom, date=date, **kwargs - )[product.id][0] + pack_price = self._compute_price_rule(product, *args, **kwargs)[ + product.id + ][0] for line in product.sudo().pack_line_ids: - pack_price += line._get_pack_line_price( - self, quantity, uom=uom, date=date, **kwargs - ) + pack_price += line._get_pack_line_price(self, *args, **kwargs) return pack_price else: - return super()._get_product_price( - product=product, quantity=quantity, uom=uom, date=date, **kwargs - ) + return super()._get_product_price(product, *args, **kwargs) - def _get_products_price(self, products, quantity, uom=None, date=False, **kwargs): + def _get_products_price(self, products, *args, **kwargs): """Compute the pricelist price for the specified pack product, qty & uom. :returns: unit price of the pack product + components, considering pricelist rules """ packs, no_packs = products.split_pack_products() - res = super()._get_products_price( - no_packs, quantity=quantity, uom=uom, date=date, **kwargs - ) + res = super()._get_products_price(no_packs, *args, **kwargs) for pack in packs: - res[pack.id] = self._get_product_price( - product=pack, quantity=quantity, uom=uom, date=date, **kwargs - ) + res[pack.id] = self._get_product_price(pack, *args, **kwargs) return res diff --git a/product_pack/views/product_pack_line_views.xml b/product_pack/views/product_pack_line_views.xml index 374d4bb6..82540d2d 100644 --- a/product_pack/views/product_pack_line_views.xml +++ b/product_pack/views/product_pack_line_views.xml @@ -18,10 +18,10 @@ product.pack.line.tree product.pack.line - + - + diff --git a/product_pack/views/product_template_views.xml b/product_pack/views/product_template_views.xml index e24a676e..d14f923b 100644 --- a/product_pack/views/product_template_views.xml +++ b/product_pack/views/product_template_views.xml @@ -46,18 +46,13 @@ name="invisible" >product_variant_count > 1 or not pack_ok - - - - You must save first to add pack lines - - + + + + You must save first to add pack lines + +
You must save first to add pack lines