[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
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user