diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py index 25a8adfca1e..5f364e32a2c 100644 --- a/erpnext/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -45,11 +45,8 @@ def get_balance_on(account=None, date=None): account = frappe.form_dict.get("account") date = frappe.form_dict.get("date") - acc = frappe.db.get_value('Account', account, \ - ['lft', 'rgt', 'report_type', 'group_or_ledger'], as_dict=1) - - if not acc: - frappe.throw(_("Account {0} does not exist").format(account), frappe.DoesNotExistError) + acc = frappe.get_doc("Account", account) + acc.check_permission("read") cond = [] if date: