summaryrefslogtreecommitdiff
path: root/addons/event
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2020-11-19 10:23:58 +0000
committerThibault Delavallée <tde@odoo.com>2020-11-19 10:23:58 +0000
commit29f12da08dbbe6037e530dcae9cf570b71894136 (patch)
treeaad56acf7f496471630e1149c1bd25f930bf15dd /addons/event
parent89a1989bd271f49a9222d5c255e03d4877045621 (diff)
[FIX] event: allow de installation of all track submodules at once
Website event track module is an advanced event module that is required notably in some sub modules: live, quizzes, exhibitors. When unchecking Schedule & Tracks in event settings, submodules checkboxes are hidden. It means that currently you may uncheck module_website_event_track while still keeping sub modules (_track_live, _track_quiz, _track_exhibitor) checked. When saving, modules are uninstalled, then installed again if one of sub module is still checked. In this commit we add an onchange so that unchecking track also unchecks all its sub modules to effectively remove them all. Task ID-2389569 closes odoo/odoo#61995 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Diffstat (limited to 'addons/event')
-rw-r--r--addons/event/models/res_config_settings.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/addons/event/models/res_config_settings.py b/addons/event/models/res_config_settings.py
index 15af322830c..14f5aebf6d9 100644
--- a/addons/event/models/res_config_settings.py
+++ b/addons/event/models/res_config_settings.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-from odoo import fields, models
+from odoo import api, fields, models
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
@@ -14,3 +14,14 @@ class ResConfigSettings(models.TransientModel):
module_website_event_questions = fields.Boolean("Registration Survey")
module_event_barcode = fields.Boolean("Barcode")
module_website_event_sale = fields.Boolean("Online Ticketing")
+
+ @api.onchange('module_website_event_track')
+ def _onchange_module_website_event_track(self):
+ """ Reset sub-modules, otherwise you may have track to False but still
+ have track_live or track_quiz to True, meaning track will come back due
+ to dependencies of modules. """
+ for config in self:
+ if not config.module_website_event_track:
+ config.module_website_event_track_live = False
+ config.module_website_event_track_quiz = False
+ config.module_website_event_track_exhibitor = False