fix: Check for Company before rendering tree in Account Tree

This commit is contained in:
marination 2020-06-11 19:54:44 +05:30
parent 0233f94570
commit c9a6e4f151

View File

@ -14,6 +14,9 @@ frappe.treeview_settings["Account"] = {
on_change: function() {
var me = frappe.treeview_settings['Account'].treeview;
var company = me.page.fields_dict.company.get_value();
if (!company) {
frappe.throw(__("Please set a Company"));
}
frappe.call({
method: "erpnext.accounts.doctype.account.account.get_root_company",
args: {