From b654fabe04e92015140d780d2a9faca2419a2ff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Warnon?= Date: Mon, 7 Jan 2019 08:37:59 +0000 Subject: [PATCH] [FIX] event_sale: fix event registration confirmation modal Task #1910927 Purpose ======= When confirming a sale order with event tickets, a modal is supposed to be shown to be able to confirm the event registration. That modal was not shown anymore. To solve it, we split the '_action_confirm' to run the actual business of the event_sale module, which is '_update_registrations', and moved the action returned in the regular 'action_confirm' method. closes odoo/odoo#29997 --- addons/event_sale/models/sale_order.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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