From 1387bc5603393f7696a92454486a2fba5ddbcf04 Mon Sep 17 00:00:00 2001 From: Sajith K Date: Wed, 14 Aug 2024 14:42:34 +0530 Subject: [PATCH] feat: enable and disable bulk edit for doctype using listview settings --- frappe/public/js/frappe/list/list_view.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/list/list_view.js b/frappe/public/js/frappe/list/list_view.js index b11c339162..67422e8caf 100644 --- a/frappe/public/js/frappe/list/list_view.js +++ b/frappe/public/js/frappe/list/list_view.js @@ -1895,6 +1895,13 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList { return frappe.perm.has_perm(doctype, 0, "submit"); }; + const is_bulk_editable = (doctype) => { + if (frappe.listview_settings[doctype] && frappe.listview_settings[doctype].enable_edit!=undefined){ + return frappe.listview_settings[doctype].enable_edit; + } + return !frappe.model.has_workflow(doctype) + }; + // utility const bulk_assignment = () => { return { @@ -2094,7 +2101,7 @@ frappe.views.ListView = class ListView extends frappe.views.BaseList { }; // bulk edit - if (has_editable_fields(doctype) && !frappe.model.has_workflow(doctype)) { + if (has_editable_fields(doctype) && is_bulk_editable(doctype)) { actions_menu_items.push(bulk_edit()); }