diff --git a/addons/event_sale/tests/test_event_sale.py b/addons/event_sale/tests/test_event_sale.py index c48e70c06f7..aae39e9cae2 100644 --- a/addons/event_sale/tests/test_event_sale.py +++ b/addons/event_sale/tests/test_event_sale.py @@ -146,7 +146,6 @@ class TestEventSale(TestEventSaleCommon): 'email': 'manual.email.2@test.example.com', }) - self.assertFalse(editor.seats_available_insufficient) editor.action_make_registration() # check editor correctly created new registrations with information coming from it or SO as fallback @@ -226,8 +225,6 @@ class TestEventSale(TestEventSaleCommon): 'default_sale_order_id': customer_so.id }).create({}) - self.assertFalse(editor.seats_available_insufficient) - editor.action_make_registration() self.assertEqual(len(self.event_0.registration_ids), TICKET_COUNT) self.assertTrue(all(reg.state == "open" for reg in self.event_0.registration_ids)) @@ -275,8 +272,6 @@ class TestEventSale(TestEventSaleCommon): 'default_sale_order_id': customer_so.id }).create({}) - self.assertTrue(editor.seats_available_insufficient) - with self.assertRaises(ValidationError): editor.action_make_registration() @@ -322,8 +317,6 @@ class TestEventSale(TestEventSaleCommon): 'default_sale_order_id': customer_so.id }).create({}) - self.assertTrue(editor.seats_available_insufficient) - with self.assertRaises(ValidationError): editor.action_make_registration() diff --git a/addons/event_sale/wizard/event_edit_registration.py b/addons/event_sale/wizard/event_edit_registration.py index b1cb8de364b..53d725e9bde 100644 --- a/addons/event_sale/wizard/event_edit_registration.py +++ b/addons/event_sale/wizard/event_edit_registration.py @@ -12,37 +12,6 @@ class RegistrationEditor(models.TransientModel): sale_order_id = fields.Many2one('sale.order', 'Sales Order', required=True, ondelete='cascade') event_registration_ids = fields.One2many('registration.editor.line', 'editor_id', string='Registrations to Edit') - seats_available_insufficient = fields.Boolean( - 'Not enough seats for all registrations', compute='_compute_seats_available_insufficient', readonly=True) - - @api.depends('event_registration_ids') - def _compute_seats_available_insufficient(self): - for editor in self: - editor.seats_available_insufficient = False - - events_counts = Counter() - event_tickets_counts = defaultdict(Counter) - - for registration in editor.event_registration_ids: - events_counts[registration.event_id] += 1 - event_tickets_counts[registration.event_id][registration.event_ticket_id] += 1 - - for event, nb_seats_event in events_counts.items(): - # Check nb of seats in each event for all registrations on sale order - try: - event._check_seats_availability(nb_seats_event) - except ValidationError: - editor.seats_available_insufficient = True - break - # Check nb of seats for each ticket of the event for all registrations on sale order - for ticket, nb_seats_ticket in event_tickets_counts[event].items(): - try: - ticket._check_seats_availability(nb_seats_ticket) - except ValidationError: - editor.seats_available_insufficient = True - break - if editor.seats_available_insufficient: - break @api.model def default_get(self, fields): diff --git a/addons/event_sale/wizard/event_edit_registration.xml b/addons/event_sale/wizard/event_edit_registration.xml index 9876f1da7bf..ddc9246e25c 100644 --- a/addons/event_sale/wizard/event_edit_registration.xml +++ b/addons/event_sale/wizard/event_edit_registration.xml @@ -6,12 +6,6 @@ registration.editor
- -

Before updating the linked registrations of please give attendee details.