fix(report): iterate on accounts only when accounts exist (#26391)
This commit is contained in:
parent
f60c3f0655
commit
bf03671a33
@ -49,12 +49,11 @@ def validate_filters(filters, account_details):
|
|||||||
if not filters.get("from_date") and not filters.get("to_date"):
|
if not filters.get("from_date") and not filters.get("to_date"):
|
||||||
frappe.throw(_("{0} and {1} are mandatory").format(frappe.bold(_("From Date")), frappe.bold(_("To Date"))))
|
frappe.throw(_("{0} and {1} are mandatory").format(frappe.bold(_("From Date")), frappe.bold(_("To Date"))))
|
||||||
|
|
||||||
for account in filters.account:
|
|
||||||
if not account_details.get(account):
|
|
||||||
frappe.throw(_("Account {0} does not exists").format(account))
|
|
||||||
|
|
||||||
if filters.get('account'):
|
if filters.get('account'):
|
||||||
filters.account = frappe.parse_json(filters.get('account'))
|
filters.account = frappe.parse_json(filters.get('account'))
|
||||||
|
for account in filters.account:
|
||||||
|
if not account_details.get(account):
|
||||||
|
frappe.throw(_("Account {0} does not exists").format(account))
|
||||||
|
|
||||||
if (filters.get("account") and filters.get("group_by") == _('Group by Account')
|
if (filters.get("account") and filters.get("group_by") == _('Group by Account')
|
||||||
and account_details[filters.account].is_group == 0):
|
and account_details[filters.account].is_group == 0):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user