Skip to content

Commit

Permalink
[IMP] event_sale_registration_answer: automatically open the answer list
Browse files Browse the repository at this point in the history
  • Loading branch information
dreispt committed Feb 7, 2024
1 parent 56bd173 commit 3f38a63
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions event_sale_registration_answer/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from . import models
from . import wizards
1 change: 1 addition & 0 deletions event_sale_registration_answer/wizards/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import registration_editor
16 changes: 16 additions & 0 deletions event_sale_registration_answer/wizards/registration_editor.py
Original file line number Diff line number Diff line change
@@ -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()

Check warning on line 15 in event_sale_registration_answer/wizards/registration_editor.py

View check run for this annotation

Codecov / codecov/patch

event_sale_registration_answer/wizards/registration_editor.py#L15

Added line #L15 was not covered by tests
return res

0 comments on commit 3f38a63

Please sign in to comment.