Skip to content

Commit

Permalink
[FIX] product_pack: include pack price in totalized
Browse files Browse the repository at this point in the history
  • Loading branch information
bruno-zanotti committed Feb 1, 2024
1 parent 6589bc9 commit 681e9ef
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions product_pack/models/product_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ def split_pack_products(self):
def price_compute(
self, price_type, uom=False, currency=False, company=False, date=False
):
packs, no_packs = self.split_pack_products()
prices = super(ProductProduct, no_packs).price_compute(
packs, _ = self.split_pack_products()
prices = super(ProductProduct, self).price_compute(
price_type, uom, currency, company, date
)
# TODO:@bruno-zanotti prefetch_fields=False still necessary?
for product in packs.with_context(prefetch_fields=False):
pack_line_prices = product.sudo().pack_line_ids._pack_line_price_compute(
price_type, uom, currency, company, date
)
prices[product.id] = sum(pack_line_prices.values())
prices[product.id] += sum(pack_line_prices.values())
return prices

@api.depends("list_price", "price_extra")
Expand Down

0 comments on commit 681e9ef

Please sign in to comment.