From 9548fcb2e54833964525702a7026f03ad66c3374 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Fri, 30 Sep 2016 17:09:40 +0200 Subject: [PATCH] [FIX] event_sale: confirm registration When a user registers for an event on the front-end, the confirmation of the associated SO will also confirm the registration. However, if a SO is created manually and a ticket event is added to it, the confirmation of the SO will not trigger the confirmation of the registration. In the second case, the registration simply doesn't exist yet at confirmation and is created by the method `default_get` of `registration.editor`. We make sure to confirm these registration when we make the final reservation. opw-688665 --- addons/event_sale/wizard/event_edit_registration.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/event_sale/wizard/event_edit_registration.py b/addons/event_sale/wizard/event_edit_registration.py index 0526db91646..11c411571a0 100644 --- a/addons/event_sale/wizard/event_edit_registration.py +++ b/addons/event_sale/wizard/event_edit_registration.py @@ -54,6 +54,9 @@ class SaleOrderEventRegistration(models.TransientModel): wiz_registration.registration_id.write(wiz_registration.get_registration_data()[0]) else: Registration.create(wiz_registration.get_registration_data()[0]) + if self.env.context.get('active_model') == 'sale.order': + for order in self.env['sale.order'].browse(self.env.context.get('active_ids', [])): + order.order_line._update_registrations(confirm=True) return {'type': 'ir.actions.act_window_close'}