From 177a26849dd0e140fe1c54ecab85ce88cc16c2fc Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Fri, 19 May 2017 18:56:25 +0530 Subject: [PATCH] [fix] Trial balance not working (#8937) --- erpnext/accounts/report/financial_statements.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/report/financial_statements.py b/erpnext/accounts/report/financial_statements.py index f6a032cb456..270ad532800 100644 --- a/erpnext/accounts/report/financial_statements.py +++ b/erpnext/accounts/report/financial_statements.py @@ -278,7 +278,7 @@ def sort_root_accounts(roots): """Sort root types as Asset, Liability, Equity, Income, Expense""" def compare_roots(a, b): - if re.split('\W+', a.value)[0].isdigit(): + if a.value and re.split('\W+', a.value)[0].isdigit(): # if chart of accounts is numbered, then sort by number return cmp(a.value, b.value) if a.report_type != b.report_type and a.report_type == "Balance Sheet":