-
- Downloads
[FIX] website_event_sale: refined boundary check for sold-out tickets
Reproduction:
1. Select an event, then set a certain maximum amount sold on a paid
ticket, set as 2 for simplicity
2. Go to the Event webpage, then buy all paid tickets
3. Fill out information and attempt to confirm the order
4. The shopping cart is cleared
Reason: We check the event ticket availability in function
_cart_update(). In V14 and V15, we added a new step to update the
pricelist when confirming an order, which will trigger _cart_update().
In V13 update_pricelist is False by default. In V14 and V15, it is
always set to True. The change is to make sure the pricelist is not
changed once the customer chooses the pricelist. As a result, for each
SO, it checks the ticket availability twice. First at when click
register or check out. Second at when submit the address information.
When selling the last ticket, the second check fails and leads to an
empty cart because the seats_reaserved is updated already at the first
step
Fix: add new checking conditions increased_quantity = new_qty > old_qty
to function _cart_update. We only check the availability again when
these new conditions are satisfied.
Current issue: This fix will restore the normal workflow for the last
ticket. But the workflow has its original issue, e.g. it doesn’t update
seats_reserved when increasing the number of tickets.
A solution in SaaS-15.3 is to forbid the customer to manually raise the
event ticket amount
For example:
1. Register 1 ticket, fill in the attendee form and click continue
2. Click review order, increase the number of tickets, then continue
3. The seats_reserved is not updated (can refresh the event page,
seats_reserved is the column confirmed)
If first register 2 tickets and then change to 1, seats_reserved will
change from 2 to 1
This is because seats_reserved is computed from the number of
registration. No new registration is needed when increase the ticket
number, but the registration will decrease when decrease the ticket
number. A solution for it is popping new registration form when the
ticket registration increases.
opw-2784720
closes odoo/odoo#87310
Signed-off-by:
Nicolas Lempereur (nle) <nle@odoo.com>
Showing
- addons/website_event_sale/models/sale_order.py 3 additions, 2 deletionsaddons/website_event_sale/models/sale_order.py
- addons/website_event_sale/static/tests/tours/website_event_sale_last_ticket.js 92 additions, 0 deletions...sale/static/tests/tours/website_event_sale_last_ticket.js
- addons/website_event_sale/tests/test_frontend_buy_tickets.py 22 additions, 0 deletionsaddons/website_event_sale/tests/test_frontend_buy_tickets.py
- addons/website_event_sale/views/assets.xml 1 addition, 0 deletionsaddons/website_event_sale/views/assets.xml
Please register or sign in to comment