From 74eb8e34da9468e85d7e11bc6024a9b93a098bf9 Mon Sep 17 00:00:00 2001 From: Saurabh Date: Wed, 7 Oct 2015 11:17:14 +0530 Subject: [PATCH] [Fixes] minor fix for fiscal year in holiday list --- erpnext/hr/doctype/holiday_list/holiday_list.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/erpnext/hr/doctype/holiday_list/holiday_list.py b/erpnext/hr/doctype/holiday_list/holiday_list.py index 84499711a5..14135be795 100644 --- a/erpnext/hr/doctype/holiday_list/holiday_list.py +++ b/erpnext/hr/doctype/holiday_list/holiday_list.py @@ -77,6 +77,9 @@ def get_events(start, end, filters=None): fiscal_year = None if filters: fiscal_year = json.loads(filters).get("fiscal_year") + + if not fiscal_year: + fiscal_year = frappe.get_doc("Global Defaults").current_fiscal_year yr_start_date, yr_end_date = get_fy_start_end_dates(fiscal_year) @@ -93,9 +96,6 @@ def get_events(start, end, filters=None): return data -def get_fy_start_end_dates(fiscal_year=None): - if not fiscal_year: - fiscal_year = frappe.get_doc("Global Defaults").current_fiscal_year - +def get_fy_start_end_dates(fiscal_year): return frappe.db.sql("""select year_start_date, year_end_date from `tabFiscal Year` where name=%s""", (fiscal_year,))[0] \ No newline at end of file