diff --git a/frappe/public/js/frappe/list/list_view.js b/frappe/public/js/frappe/list/list_view.js index f3af9bd1be..4d701fe55e 100644 --- a/frappe/public/js/frappe/list/list_view.js +++ b/frappe/public/js/frappe/list/list_view.js @@ -136,7 +136,7 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList { this.workflow_action_items = {}; const actions = this.actions_menu_items.concat(this.workflow_action_menu_items); - actions.map((item) => { + actions.forEach((item) => { const $item = this.page.add_actions_menu_item(item.label, item.action, item.standard); if (item.class) { $item.addClass(item.class); @@ -1669,6 +1669,8 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList { get_workflow_action_menu_items() { const workflow_actions = []; + const me = this; + if (frappe.model.has_workflow(this.doctype)) { const actions = frappe.workflow.get_all_transition_actions(this.doctype); actions.forEach((action) => { @@ -1676,11 +1678,16 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList { label: __(action), name: action, action: () => { - frappe.xcall("frappe.model.workflow.bulk_workflow_approval", { - docnames: this.get_checked_items(true), - doctype: this.doctype, - action: action, - }); + me.disable_list_update = true; + frappe + .xcall("frappe.model.workflow.bulk_workflow_approval", { + docnames: this.get_checked_items(true), + doctype: this.doctype, + action: action, + }) + .finally(() => { + me.disable_list_update = false; + }); }, is_workflow_action: true, });