summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorjvm-odoo <jvm@odoo.com>2019-11-13 09:17:49 +0000
committerfw-bot <otis@odoo.com>2019-11-14 09:11:26 +0000
commitee0199cac4f58bc8aefd0ea1410d16fb6b9f4e31 (patch)
tree15a8be65a9da54d78781882b378566aea8f93741 /addons
parent67044d64cdee723515c14ebc62575644d7c37b47 (diff)
[FIX] website_sale: removing invalid product from the cart
Reproduce the issue: - Install eCommerce app - Publish a product to your website - Add the product in your cart - Unpublish/make unsellable/archive the product The product is still in the cart and the checkout process can be done. Cause: There is no check for invalid products before displaying the cart This commit remove the invalid products while loading the cart. OPW-2092541 closes odoo/odoo#40241 X-original-commit: ab9290e39c2d2b9eb6d6f9972c1c8b546263edfd Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/website_sale/controllers/main.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/addons/website_sale/controllers/main.py b/addons/website_sale/controllers/main.py
index 435ff2ce5d2..405cd3f5690 100644
--- a/addons/website_sale/controllers/main.py
+++ b/addons/website_sale/controllers/main.py
@@ -404,6 +404,7 @@ class WebsiteSale(http.Controller):
'suggested_products': [],
})
if order:
+ order.order_line.filtered(lambda l: not l.product_id.active).unlink()
_order = order
if not request.env.context.get('pricelist'):
_order = order.with_context(pricelist=order.pricelist_id.id)