From bf9890f98cbd9adceb369a25ddbcae4fbebeda9a Mon Sep 17 00:00:00 2001 From: Dhruv Patel Date: Tue, 5 May 2020 12:35:29 +0000 Subject: [PATCH] [FIX] web: force refresh on expired session popup button click Currently, when the session expired then it generates the popup that "Your odoo session expired. Please refresh the current page." Now once you click on the "Ok" button only close the popup and user have to manually do refresh the page. with this commit, we have changed the text of the popup to "Your odoo session expired. The current page is about to be refreshed." and when user click on "Ok" button forcefully refresh the page. Task : 2241744 closes odoo/odoo#50710 Signed-off-by: Aaron Bohy (aab) --- addons/web/static/src/js/services/crash_manager.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/services/crash_manager.js b/addons/web/static/src/js/services/crash_manager.js index b653aaa1c8d..ea0927a9f28 100644 --- a/addons/web/static/src/js/services/crash_manager.js +++ b/addons/web/static/src/js/services/crash_manager.js @@ -354,7 +354,18 @@ core.crash_registry.add('odoo.exceptions.RedirectWarning', RedirectWarningHandle function session_expired(cm) { return { display: function () { - cm.show_warning({type: _t("Odoo Session Expired"), message: _t("Your Odoo session expired. Please refresh the current web page.")}); + const notif = { + type: _t("Odoo Session Expired"), + message: _t("Your Odoo session expired. The current page is about to be refreshed."), + }; + const options = { + buttons: [{ + text: _t("Ok"), + click: () => window.location.reload(true), + close: true + }], + }; + cm.show_warning(notif, options); } }; }