fix: kanban hide "add column" for std fields (#24707)

* fix: build events

* fix(kanban): Don't show custom column option on standard fields
This commit is contained in:
Ankush Menat 2024-02-02 18:31:03 +05:30 committed by GitHub
parent dd839e4d50
commit 6341ef3ac7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View file

@ -17,7 +17,7 @@ frappe.realtime.on("build_event", (data) => {
if (parts.length === 2) {
let filename = parts[0].split("/").slice(-1)[0];
frappe.assets.executed_ = frappe.assets.executed_.filter(
frappe.assets._executed = frappe.assets._executed.filter(
(asset) => !asset.includes(`${filename}.bundle`)
);
}

View file

@ -377,8 +377,13 @@ frappe.provide("frappe.views");
}
function bind_add_column() {
if (!self.board_perms.write) {
let doctype = self.cur_list.doctype;
let fieldname = self.cur_list.board.field_name;
const is_custom_field = frappe.meta.get_docfield(doctype, fieldname)?.is_custom_field;
if (!self.board_perms.write || !is_custom_field) {
// If no write access to board, editing board (by adding column) should be blocked
// If standard field then users can't add options
self.$kanban_board.find(".add-new-column").remove();
return;
}