[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
This commit is contained in:
Yoshi Tashiro
2018-11-02 11:10:52 +01:00
committed by Romain Derie
parent 3457d1a74b
commit 7d2bc7d35a
+3
View File
@@ -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