From c5b8f7eb46032723e31a99456e5744186ea2e0e8 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 30 Apr 2015 16:10:58 +0530 Subject: [PATCH] fix in trends report --- erpnext/controllers/trends.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/erpnext/controllers/trends.py b/erpnext/controllers/trends.py index 3d5e690c7c..16387a5c4c 100644 --- a/erpnext/controllers/trends.py +++ b/erpnext/controllers/trends.py @@ -31,7 +31,10 @@ def validate_filters(filters): for f in ["Fiscal Year", "Based On", "Period", "Company"]: if not filters.get(f.lower().replace(" ", "_")): frappe.throw(_("{0} is mandatory").format(f)) - + + if not frappe.db.exists("Fiscal Year", filters.get("fiscal_year")): + frappe.throw(_("Fiscal Year: {0} does not exists").format(filters.get("fiscal_year"))) + if filters.get("based_on") == filters.get("group_by"): frappe.throw(_("'Based On' and 'Group By' can not be same"))