From 824376a045b2bc9181636914aa117d3f0af4d8aa Mon Sep 17 00:00:00 2001 From: Rucha Mahabal Date: Tue, 24 Sep 2019 19:13:55 +0530 Subject: [PATCH] fix(Journal Entry): Opening Entry not fetching accounts (#19148) --- erpnext/accounts/doctype/journal_entry/journal_entry.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py index eb75d0d284..e25942ca34 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.py +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py @@ -827,10 +827,10 @@ def get_opening_accounts(company): accounts = frappe.db.sql_list("""select name from tabAccount where - is_group=0 and report_type='Balance Sheet' and company=%s and - name not in(select distinct account from tabWarehouse where + is_group=0 and report_type='Balance Sheet' and company={0} and + name not in (select distinct account from tabWarehouse where account is not null and account != '') - order by name asc""", frappe.db.escape(company)) + order by name asc""".format(frappe.db.escape(company))) return [{"account": a, "balance": get_balance_on(a)} for a in accounts]