Update chart_of_accounts.py
diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py b/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py
index dc98db1..737b34a 100644
--- a/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py
+++ b/erpnext/accounts/doctype/account/chart_of_accounts/chart_of_accounts.py
@@ -165,7 +165,7 @@
 		tree[child.account_name] = {}
 		
 		# assign account_type and root_type
-		if child.account_type:
+		if child.account_number:
 			tree[child.account_name]["account_number"] = child.account_number
 		if child.account_type:
 			tree[child.account_name]["account_type"] = child.account_type
@@ -175,4 +175,4 @@
 			tree[child.account_name]["root_type"] = child.root_type
 			
 		# call recursively to build a subtree for current account
-		build_account_tree(tree[child.account_name], child, all_accounts)
\ No newline at end of file
+		build_account_tree(tree[child.account_name], child, all_accounts)