From 79bfb23488403a433514b2b04625b8d55d3d56ae Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Fri, 18 Jan 2019 13:12:36 +0000 Subject: [PATCH] [FIX] website_sale_wishlist: new price - Create a Public Pricelist without discounts - Create a pricelist with a discount for all products, with 'Discount Policy' set to 'Show public price & discount to the customer' - Assign the discount pricelist to the administrator partner - Go to the eCommerce as public user (or any user with the Public Pricelist as default) - Add a product to the Wishlist - Go to the Wishlist The discount of the admin pricelist is shown. This is because the `product.wishlist` is browsed as superuser and the computed field `price_new` depends on the user (ultimately through `_website_price`) opw-1912726 closes odoo/odoo#30358 --- addons/website_sale_wishlist/models/product_wishlist.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_sale_wishlist/models/product_wishlist.py b/addons/website_sale_wishlist/models/product_wishlist.py index 381d5eceb45..d6b17d702f8 100644 --- a/addons/website_sale_wishlist/models/product_wishlist.py +++ b/addons/website_sale_wishlist/models/product_wishlist.py @@ -44,7 +44,7 @@ class ProductWishlist(models.Model): "&", ("partner_id", "=", False), ("session", "=", self.env.user.current_session), - ]).filtered('product_id.product_tmpl_id.website_published') + ]).filtered('product_id.product_tmpl_id.website_published').sudo(user=self.env.user) @api.model def _add_to_wishlist(self, pricelist_id, currency_id, website_id, price, product_id, partner_id=False, session=False):