From 9e697a2e8235b44bc59320a4178af8be228cb89d Mon Sep 17 00:00:00 2001 From: Gavin D'souza Date: Fri, 20 Sep 2019 22:39:45 +0530 Subject: [PATCH] fix: turn off desk refresh for each update in bulk operations: updating multiple documents --- frappe/public/js/frappe/list/list_view.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/list/list_view.js b/frappe/public/js/frappe/list/list_view.js index 5f9aac0afb..79cf6f1986 100644 --- a/frappe/public/js/frappe/list/list_view.js +++ b/frappe/public/js/frappe/list/list_view.js @@ -124,7 +124,14 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList { const actions = this.actions_menu_items.concat(this.workflow_action_menu_items); actions.map(item => { - const $item = this.page.add_actions_menu_item(item.label, item.action, item.standard); + let action = () => { + frappe.run_serially([ + this.toggle_auto_refresh(false), + item.action, + this.toggle_auto_refresh(true) + ]) + } + const $item = this.page.add_actions_menu_item(item.label, action, item.standard); if (item.class) { $item.addClass(item.class); } @@ -135,6 +142,10 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList { }); } + toggle_auto_refresh(state) { + this.list_view_settings.disable_auto_refresh = !state; + } + show_restricted_list_indicator_if_applicable() { const match_rules_list = frappe.perm.get_match_rules(this.doctype); if(match_rules_list.length) {