[minor] Check account read permission for get_balance_on

This commit is contained in:
Anand Doshi 2014-08-01 16:13:44 +05:30
parent 6c608e04bc
commit 8c838061f9

View File

@ -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: