Skip to content
Snippets Groups Projects
Commit 22f652dd authored by Thomas Lefebvre (thle)'s avatar Thomas Lefebvre (thle)
Browse files

[FIX] website_event_sale: clear cart element in the session


Steps to reproduce:
-------------------
- create and pay with ewallet a cart with a ticket;
- create and pay with ewallet an other cart with a ticket;

Remark:
Don't clear element in the session like 'sale_order_id', etc.
For example, by moving the mouse over the cart or by making a payment process.

Issue:
------
An error is raised with the message:
"It is forbidden to modify a sales order which is not in draft status.".

Cause:
------
We apply an update to the cart on a sale order which is not in draft.

Solution:
---------
Make sure we are working on a sale order in draft
when applying a registration post.
If not, clear session elements.

opw-3465937

closes odoo/odoo#132832

Signed-off-by: default avatarThomas Lefebvre (thle) <thle@odoo.com>
parent e7632a3b
No related branches found
No related tags found
No related merge requests found
......@@ -32,6 +32,9 @@ class WebsiteEventSaleController(WebsiteEventController):
return super()._create_attendees_from_registration_post(event, registration_data)
order_sudo = request.website.sale_get_order(force_create=True)
if order_sudo.state != 'draft':
request.website.sale_reset()
order_sudo = request.website.sale_get_order(force_create=True)
tickets_data = defaultdict(int)
for data in registration_data:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment