[Fix] Employees working on a holiday report's date filter not working (#9108)

This commit is contained in:
rohitwaghchaure 2017-06-01 18:57:34 +05:30 committed by Nabin Hait
parent 0b8f920e22
commit 7f2513f7a1

View File

@ -25,11 +25,10 @@ def get_columns():
] ]
def get_employees(filters): def get_employees(filters):
holiday_filter = {"holiday_date": (">=", filters.from_date), holiday_filter = [["holiday_date", ">=", filters.from_date], ["holiday_date", "<=", filters.to_date]]
"holiday_date": ("<=", filters.to_date)}
if filters.holiday_list: if filters.holiday_list:
holiday_filter["parent"] = filters.holiday_list holiday_filter.append(["parent", "=", filters.holiday_list])
holidays = frappe.get_all("Holiday", fields=["holiday_date", "description"], holidays = frappe.get_all("Holiday", fields=["holiday_date", "description"],
filters=holiday_filter) filters=holiday_filter)