From b0dbdc143928466ca1d50223f6491442710ed2f1 Mon Sep 17 00:00:00 2001 From: Saurabh Date: Wed, 7 Oct 2015 11:27:25 +0530 Subject: [PATCH] minor fixes --- erpnext/hr/doctype/holiday_list/holiday_list.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/erpnext/hr/doctype/holiday_list/holiday_list.py b/erpnext/hr/doctype/holiday_list/holiday_list.py index 14135be795..c5d93ef617 100644 --- a/erpnext/hr/doctype/holiday_list/holiday_list.py +++ b/erpnext/hr/doctype/holiday_list/holiday_list.py @@ -79,7 +79,7 @@ def get_events(start, end, filters=None): fiscal_year = json.loads(filters).get("fiscal_year") if not fiscal_year: - fiscal_year = frappe.get_doc("Global Defaults").current_fiscal_year + fiscal_year = frappe.db.get_value("Global Defaults", None, "current_fiscal_year") yr_start_date, yr_end_date = get_fy_start_end_dates(fiscal_year) @@ -95,7 +95,5 @@ def get_events(start, end, filters=None): return data - 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 + return frappe.db.get_value("Fiscal Year", fiscal_year, ["year_start_date", "year_end_date"]) \ No newline at end of file