mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 10:49:09 +00:00
fix: Allow to add child account if ignore validation checked
This commit is contained in:
@@ -23,6 +23,10 @@ frappe.treeview_settings["Account"] = {
|
|||||||
if(r.message) {
|
if(r.message) {
|
||||||
let root_company = r.message.length ? r.message[0] : "";
|
let root_company = r.message.length ? r.message[0] : "";
|
||||||
me.page.fields_dict.root_company.set_value(root_company);
|
me.page.fields_dict.root_company.set_value(root_company);
|
||||||
|
|
||||||
|
frappe.db.get_value("Company", {"name": company}, "ignore_root_company_validation", (r) => {
|
||||||
|
frappe.flags.ignore_root_company_validation = r.ignore_root_company_validation;
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -133,9 +137,10 @@ frappe.treeview_settings["Account"] = {
|
|||||||
{
|
{
|
||||||
label:__("Add Child"),
|
label:__("Add Child"),
|
||||||
condition: function(node) {
|
condition: function(node) {
|
||||||
return frappe.boot.user.can_create.indexOf("Account") !== -1 &&
|
return frappe.boot.user.can_create.indexOf("Account") !== -1
|
||||||
!frappe.treeview_settings['Account'].treeview.page.fields_dict.root_company.get_value() &&
|
&& (!frappe.treeview_settings['Account'].treeview.page.fields_dict.root_company.get_value()
|
||||||
node.expandable && !node.hide_add;
|
|| frappe.flags.ignore_root_company_validation)
|
||||||
|
&& node.expandable && !node.hide_add;
|
||||||
},
|
},
|
||||||
click: function() {
|
click: function() {
|
||||||
var me = frappe.treeview_settings['Account'].treeview;
|
var me = frappe.treeview_settings['Account'].treeview;
|
||||||
|
|||||||
Reference in New Issue
Block a user