[FIX] website_event_sale: do not tell the ticket is

sold out or has not enough seats if it is unlimited.
This commit is contained in:
Thibault Delavallée
2015-03-20 16:15:03 +01:00
parent e1f26d52ee
commit da09947121
@@ -65,13 +65,13 @@ class sale_order(osv.Model):
# case: buying tickets for a sold out ticket
values = {}
if ticket and ticket.seats_available <= 0:
if ticket and ticket.seats_availability == 'limited' and ticket.seats_available <= 0:
values['warning'] = _('Sorry, The %(ticket)s tickets for the %(event)s event are sold out.') % {
'ticket': ticket.name,
'event': ticket.event_id.name}
new_qty, set_qty, add_qty = 0, 0, 0
# case: buying tickets, too much attendees
elif ticket and new_qty > ticket.seats_available:
elif ticket and ticket.seats_availability == 'limited' and new_qty > ticket.seats_available:
values['warning'] = _('Sorry, only %(remaining_seats)d seats are still available for the %(ticket)s ticket for the %(event)s event.') % {
'remaining_seats': ticket.seats_available,
'ticket': ticket.name,