From 5b790a00955a7b18fc85a0fd11829ff71d47232a Mon Sep 17 00:00:00 2001 From: marination Date: Tue, 13 Oct 2020 02:37:55 +0530 Subject: [PATCH] fix: Convert dates to datetime.date before comparing in Holiday List --- erpnext/hr/doctype/holiday_list/holiday_list.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/hr/doctype/holiday_list/holiday_list.py b/erpnext/hr/doctype/holiday_list/holiday_list.py index 76dc9429f1..6df7bc88c0 100644 --- a/erpnext/hr/doctype/holiday_list/holiday_list.py +++ b/erpnext/hr/doctype/holiday_list/holiday_list.py @@ -1,3 +1,4 @@ + # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt @@ -32,7 +33,7 @@ class HolidayList(Document): def validate_days(self): - if self.from_date > self.to_date: + if getdate(self.from_date) > getdate(self.to_date): throw(_("To Date cannot be before From Date")) for day in self.get("holidays"):