fix: turn off desk refresh for each update in bulk operations: updating multiple documents

This commit is contained in:
Gavin D'souza 2019-09-20 22:39:45 +05:30
parent 7ef5b20ca4
commit 9e697a2e82

View file

@ -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) {