Skip to content
Snippets Groups Projects
Commit 8646b004 authored by Goffin Simon's avatar Goffin Simon
Browse files

[FIX] website_sale_wishlist: Product with sale_ok = False in wishlist


Steps to reproduce the bug:

- Let's consider a sellable product P published on the shop
- Let's consider a portal user PU adding P in his wishlist W
- Set P with sale_ok = False (meaning unsellable)
- With PU try to see W

Bug:

A 430 error was raised because the product P was not sellable

opw:2362184

closes odoo/odoo#60523

Signed-off-by: default avatarJérémy Kersten (jke) <jke@openerp.com>
parent 1ac67480
Branches
Tags
No related merge requests found
......@@ -33,7 +33,7 @@ class ProductWishlist(models.Model):
else:
wish = self.search([("partner_id", "=", self.env.user.partner_id.id), ('website_id', '=', request.website.id)])
return wish.filtered(lambda x: x.sudo().product_id.product_tmpl_id.website_published)
return wish.filtered(lambda x: x.sudo().product_id.product_tmpl_id.website_published and x.sudo().product_id.product_tmpl_id.sale_ok)
@api.model
def _add_to_wishlist(self, pricelist_id, currency_id, website_id, price, product_id, partner_id=False):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment