[minor] Check account read permission for get_balance_on
This commit is contained in:
parent
6c608e04bc
commit
8c838061f9
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user