From 576efed7f5a9cd29d01e746bcd506bde4292a811 Mon Sep 17 00:00:00 2001 From: hrwx Date: Mon, 15 Nov 2021 14:35:56 +0000 Subject: [PATCH] chore: move timezone clear cache to on_update --- frappe/core/doctype/system_settings/system_settings.js | 8 +++++--- frappe/core/doctype/user/user.js | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/frappe/core/doctype/system_settings/system_settings.js b/frappe/core/doctype/system_settings/system_settings.js index 0164a1a683..4eeab0274b 100644 --- a/frappe/core/doctype/system_settings/system_settings.js +++ b/frappe/core/doctype/system_settings/system_settings.js @@ -33,8 +33,10 @@ frappe.ui.form.on("System Settings", { } } }, - after_save: function(frm) { - // Clear cache after saving to refresh the values of boot. - frappe.ui.toolbar.clear_cache(); + on_update: function(frm) { + if (frappe.boot.time_zone && frappe.boot.time_zone.system !== frm.doc.time_zone) { + // Clear cache after saving to refresh the values of boot. + frappe.ui.toolbar.clear_cache(); + } } }); diff --git a/frappe/core/doctype/user/user.js b/frappe/core/doctype/user/user.js index 681080b2b3..79c2665a05 100644 --- a/frappe/core/doctype/user/user.js +++ b/frappe/core/doctype/user/user.js @@ -273,9 +273,11 @@ frappe.ui.form.on('User', { } }); }, - after_save: function(frm) { - // Clear cache after saving to refresh the values of boot. - frappe.ui.toolbar.clear_cache(); + on_update: function(frm) { + if (frappe.boot.time_zone && frappe.boot.time_zone.user !== frm.doc.time_zone) { + // Clear cache after saving to refresh the values of boot. + frappe.ui.toolbar.clear_cache(); + } } });