General ledger report: invalid account

This commit is contained in:
Nabin Hait 2014-08-18 15:38:04 +05:30
parent dcce0c86ed
commit 32a3a86a00

View File

@ -20,6 +20,9 @@ def execute(filters=None):
return columns, res
def validate_filters(filters, account_details):
if filters.get("account") and not account_details.get(filters.account):
frappe.throw(_("Account {0} does not exists").format(filters.account))
if filters.get("account") and filters.get("group_by_account") \
and account_details[filters.account].group_or_ledger == "Ledger":
frappe.throw(_("Can not filter based on Account, if grouped by Account"))