diff options
| author | Yoshi Tashiro <tashiro@quartile.co> | 2018-10-26 16:07:03 +0000 |
|---|---|---|
| committer | Romain Derie <rde@odoo.com> | 2018-11-02 11:10:52 +0100 |
| commit | 7d2bc7d35aaee217659b36631ec2ba6eaff3504f (patch) | |
| tree | 2de00f451c99587cd1afe0a016064c99722456e8 | |
| parent | 3457d1a74bb687eb42b65949bb61a10056520442 (diff) | |
[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
| -rw-r--r-- | addons/website_sale/controllers/main.py | 3 |
1 files changed, 3 insertions, 0 deletions
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 |
