-
-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] event_sale_registration_answer: automatically open the answer list
- Loading branch information
Showing
3 changed files
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from . import models | ||
from . import wizards |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import registration_editor |
16 changes: 16 additions & 0 deletions
16
event_sale_registration_answer/wizards/registration_editor.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
return res |