From 34acc63d3fa52ce273cf3dff7d5f000905c1df50 Mon Sep 17 00:00:00 2001 From: "Nasreddin Boulif (bon)" Date: Thu, 22 Feb 2024 19:45:13 +0100 Subject: [PATCH] [FIX] website_event_sale: don't display ticket for canceled attendees MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Steps to reproduce the issue: - Install `website_event_sale` module - Create an event with a paid ticket - Go to website and register for the event for 2 persons - Go to the cart and remove one of the attendees - Proceed to checkout and confirm the order - On the checkout confirmation page, click on `Download tickets` - Open the downloaded PDF file Issue: Two tickets are displayed in the PDF file. Cause: Not filtering out the canceled attendees. Solution: Display tickets only for `Attended` and `Registered` attendees. opw-3718542 closes odoo/odoo#155125 Signed-off-by: Jérémy Hennecart (jeh) --- addons/website_event_sale/controllers/sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_event_sale/controllers/sale.py b/addons/website_event_sale/controllers/sale.py index b5e8f845394..ba0b6304704 100644 --- a/addons/website_event_sale/controllers/sale.py +++ b/addons/website_event_sale/controllers/sale.py @@ -12,7 +12,7 @@ class WebsiteEventSale(WebsiteSale): self)._prepare_shop_payment_confirmation_values(order) values['events'] = order.order_line.event_id attendee_per_event_read_group = request.env['event.registration'].sudo()._read_group( - [('sale_order_id', '=', order.id)], + [('sale_order_id', '=', order.id), ('state', 'in', ['open', 'done'])], groupby=['event_id'], aggregates=['id:array_agg'], )