[FIX] website_event_sale: ensure sale_last_order_id is set in session

This commit fixes an issue where the `sale_last_order_id` was not being
set in the session when the extra info step was added to the checkout
process. This caused an error during the validation of event payment in
`shop_payment_validate`.

Steps to reproduce the issue:
1. Install `website_event_sale` and set up a payment provider.
2. Add the extra info step to the checkout in the website.
3. Register for a paid event from the website.
4. Proceed to pay the order, which would previously result in an error.

opw-3864873

closes odoo/odoo#162657

Signed-off-by: Jérémy Hennecart (jeh) <jeh@odoo.com>
This commit is contained in:
Pedram (pebr)
2024-04-25 11:21:50 +00:00
parent 3b3d4cb55b
commit a2a59d1e69
@@ -62,6 +62,7 @@ class WebsiteEventSaleController(WebsiteEventController):
if any(info['event_ticket_id'] for info in registrations):
order_sudo = request.website.sale_get_order()
if order_sudo.amount_total:
request.session['sale_last_order_id'] = order_sudo.id
return request.redirect("/shop/checkout")
# free tickets -> order with amount = 0: auto-confirm, no checkout
elif order_sudo: