diff --git a/event_sale_registration_answer/__init__.py b/event_sale_registration_answer/__init__.py index 0650744f6..aee8895e7 100644 --- a/event_sale_registration_answer/__init__.py +++ b/event_sale_registration_answer/__init__.py @@ -1 +1,2 @@ from . import models +from . import wizards diff --git a/event_sale_registration_answer/wizards/__init__.py b/event_sale_registration_answer/wizards/__init__.py new file mode 100644 index 000000000..815eb773b --- /dev/null +++ b/event_sale_registration_answer/wizards/__init__.py @@ -0,0 +1 @@ +from . import registration_editor diff --git a/event_sale_registration_answer/wizards/registration_editor.py b/event_sale_registration_answer/wizards/registration_editor.py new file mode 100644 index 000000000..feafa70a2 --- /dev/null +++ b/event_sale_registration_answer/wizards/registration_editor.py @@ -0,0 +1,16 @@ +# Copyright (C) 2024 Open Source Integrators (https://www.opensourceintegrators.com) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import models + + +class RegistrationEditor(models.TransientModel): + _inherit = "registration.editor" + + def action_make_registration(self): + res = super().action_make_registration() + self.ensure_one() + # If there are answer to populate, open the list after the Registrations popup + answers = self.sale_order_id.registration_ids.registration_answer_ids + if answers: + res = self.sale_order_id.action_view_questions_list() + return res