diff --git a/addons/event_sale/models/sale_order.py b/addons/event_sale/models/sale_order.py index b749f615293..1b15093de03 100644 --- a/addons/event_sale/models/sale_order.py +++ b/addons/event_sale/models/sale_order.py @@ -12,8 +12,16 @@ class SaleOrder(models.Model): for so in self: # confirm registration if it was free (otherwise it will be confirmed once invoice fully paid) so.order_line._update_registrations(confirm=so.amount_total == 0, cancel_to_draft=False) + return res + + @api.multi + def action_confirm(self): + res = super(SaleOrder, self).action_confirm() + for so in self: if any(so.order_line.filtered(lambda line: line.event_id)): - return self.env['ir.actions.act_window'].with_context(default_sale_order_id=so.id).for_xml_id('event_sale', 'action_sale_order_event_registration') + return self.env['ir.actions.act_window'] \ + .with_context(default_sale_order_id=so.id) \ + .for_xml_id('event_sale', 'action_sale_order_event_registration') return res