diff --git a/auth_session_timeout/__manifest__.py b/auth_session_timeout/__manifest__.py index e155747d1a..c9a28afbbf 100644 --- a/auth_session_timeout/__manifest__.py +++ b/auth_session_timeout/__manifest__.py @@ -13,7 +13,7 @@ "maintainer": "Odoo Community Association (OCA)", "website": "https://github.com/OCA/server-auth", "category": "Tools", - "version": "15.0.1.0.0", + "version": "15.0.1.0.1", "license": "AGPL-3", "data": ["data/ir_config_parameter_data.xml"], "installable": True, diff --git a/auth_session_timeout/data/ir_config_parameter_data.xml b/auth_session_timeout/data/ir_config_parameter_data.xml index b64c5a8c61..c7dfd81922 100644 --- a/auth_session_timeout/data/ir_config_parameter_data.xml +++ b/auth_session_timeout/data/ir_config_parameter_data.xml @@ -9,6 +9,8 @@ inactive_session_time_out_ignored_url - /calendar/notify,/longpolling/poll + /calendar/notify,/longpolling/poll,/longpolling/im_status diff --git a/auth_session_timeout/migrations/15.0.1.0.1/post-migration.py b/auth_session_timeout/migrations/15.0.1.0.1/post-migration.py new file mode 100644 index 0000000000..b565213e15 --- /dev/null +++ b/auth_session_timeout/migrations/15.0.1.0.1/post-migration.py @@ -0,0 +1,28 @@ +import logging + +from odoo import SUPERUSER_ID, api + +_logger = logging.getLogger(__name__) + + +def migrate(cr, version): + add_controller_to_parameter(cr) + + +def add_controller_to_parameter(cr): + """Add /longpolling/im_status because it is executed several times (every 50 seconds)""" + env = api.Environment(cr, SUPERUSER_ID, {}) + new_url = "/longpolling/im_status" + ignored_path_key = "inactive_session_time_out_ignored_url" + param = env["ir.config_parameter"] + old_value = param.get_param(ignored_path_key, "") + if new_url in old_value: + _logger.info( + "%s is included in the parameter %s already.", new_url, ignored_path_key + ) + return + new_value = "%s,%s" % (old_value, new_url) + param.set_param(ignored_path_key, new_value) + _logger.info( + "%s was added to the parameter %s successfully.", new_url, ignored_path_key + )