[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) <aab@odoo.com>
This commit is contained in:
Dhruv Patel
2020-05-29 08:00:01 +00:00
committed by Aaron Bohy
parent 042b4060bd
commit bf9890f98c
@@ -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);
}
};
}