[FIX] website_event_sale: don't display ticket for canceled attendees

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) <jeh@odoo.com>
This commit is contained in:
Nasreddin Boulif (bon)
2024-02-26 21:22:53 +00:00
parent a404654c18
commit 34acc63d3f
@@ -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'],
)