From a2a59d1e69ccc899ffd6a4404d66030f35fb5f6c Mon Sep 17 00:00:00 2001 From: "Pedram (pebr)" Date: Fri, 19 Apr 2024 17:20:41 +0200 Subject: [PATCH] [FIX] website_event_sale: ensure sale_last_order_id is set in session MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- addons/website_event_sale/controllers/main.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/website_event_sale/controllers/main.py b/addons/website_event_sale/controllers/main.py index fcfd87730c5..eecfb2ce77e 100644 --- a/addons/website_event_sale/controllers/main.py +++ b/addons/website_event_sale/controllers/main.py @@ -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: