From 7d2bc7d35aaee217659b36631ec2ba6eaff3504f Mon Sep 17 00:00:00 2001 From: Yoshi Tashiro Date: Fri, 26 Oct 2018 16:07:03 +0000 Subject: [PATCH] [FIX] website_sale: reset cart if checkout was done in another session This commit extend commit https://github.com/odoo/odoo/commit/ef48b81ab127dd717a4a9d106edd5c51121bc8f7 When you have a cart on multiple session and confirm the card in one of them, you could still access your cart from other session (note that you could not do anything with it as it would be reset when adding product or changing qty). Closes #28210 --- addons/website_sale/controllers/main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/website_sale/controllers/main.py b/addons/website_sale/controllers/main.py index 8a8898fe3ae..c3c3c41c43f 100644 --- a/addons/website_sale/controllers/main.py +++ b/addons/website_sale/controllers/main.py @@ -341,6 +341,9 @@ class WebsiteSale(http.Controller): @http.route(['/shop/cart'], type='http', auth="public", website=True) def cart(self, **post): order = request.website.sale_get_order() + if order and order.state != 'draft': + request.session['sale_order_id'] = None + order = request.website.sale_get_order() if order: from_currency = order.company_id.currency_id to_currency = order.pricelist_id.currency_id