diff --git a/erpnext/accounts/doctype/account/account_tree.js b/erpnext/accounts/doctype/account/account_tree.js index dc4c69d9e8..b70c6d2b27 100644 --- a/erpnext/accounts/doctype/account/account_tree.js +++ b/erpnext/accounts/doctype/account/account_tree.js @@ -121,7 +121,7 @@ frappe.treeview_settings["Account"] = { }, onrender: function(node) { if(frappe.boot.user.can_read.indexOf("GL Entry") !== -1){ - var dr_or_cr = node.data.balance < 0 ? "Cr" : "Dr"; + var dr_or_cr = in_list(["Liability", "Income", "Equity"], node.data.root_type) ? "Cr" : "Dr"; if (node.data && node.data.balance!==undefined) { $('' + (node.data.balance_in_account_currency ? diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py index 542c7e4e52..e75dd957db 100644 --- a/erpnext/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -734,6 +734,7 @@ def get_children(doctype, parent, company, is_root=False): parent_fieldname = 'parent_' + doctype.lower().replace(' ', '_') fields = [ 'name as value', + 'root_type', 'is_group as expandable' ] filters = [['docstatus', '<', 2]] @@ -741,7 +742,7 @@ def get_children(doctype, parent, company, is_root=False): filters.append(['ifnull(`{0}`,"")'.format(parent_fieldname), '=', '' if is_root else parent]) if is_root: - fields += ['root_type', 'report_type', 'account_currency'] if doctype == 'Account' else [] + fields += ['report_type', 'account_currency'] if doctype == 'Account' else [] filters.append(['company', '=', company]) else: