From 8c838061f96f98cba1877547a72fa92ee7235079 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 1 Aug 2014 16:13:44 +0530 Subject: [PATCH] [minor] Check account read permission for get_balance_on --- erpnext/accounts/utils.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py index 25a8adfca1..5f364e32a2 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: