mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-16 16:15:02 +00:00
fix: prevent creation of root accounts in account tree view
This commit is contained in:
@@ -236,6 +236,10 @@ frappe.treeview_settings["Account"] = {
|
||||
root_company,
|
||||
]);
|
||||
} else {
|
||||
const node = treeview.tree.get_selected_node();
|
||||
if (node.is_root) {
|
||||
frappe.throw(__("Cannot create root account."));
|
||||
}
|
||||
treeview.new_node();
|
||||
}
|
||||
},
|
||||
@@ -254,7 +258,8 @@ frappe.treeview_settings["Account"] = {
|
||||
].treeview.page.fields_dict.root_company.get_value() ||
|
||||
frappe.flags.ignore_root_company_validation) &&
|
||||
node.expandable &&
|
||||
!node.hide_add
|
||||
!node.hide_add &&
|
||||
!node.is_root
|
||||
);
|
||||
},
|
||||
click: function () {
|
||||
|
||||
Reference in New Issue
Block a user