sort by name accounts
diff --git a/erpnext/accounts/report/trial_balance/trial_balance.py b/erpnext/accounts/report/trial_balance/trial_balance.py
index 21f5175..8c55df5 100644
--- a/erpnext/accounts/report/trial_balance/trial_balance.py
+++ b/erpnext/accounts/report/trial_balance/trial_balance.py
@@ -175,7 +175,7 @@
 
 def prepare_data(accounts, filters, total_row, parent_children_map, company_currency):
 	data = []
-	tmpaccnt = sorted(accounts, key = account: account.name)
+	tmpaccnt = sorted(accounts, key = lambda account: account.name)
 	if not (accounts[0].account_number is None):
 		accounts = tmpaccnt