From 7b8e1e089148ae9b1375133b6de78c01b927d8c4 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Wed, 22 Jan 2020 14:43:37 +0530 Subject: [PATCH] fix: lead date comparison issue --- erpnext/crm/doctype/lead/lead.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/crm/doctype/lead/lead.py b/erpnext/crm/doctype/lead/lead.py index 6cab18dc1c..73ef79b894 100644 --- a/erpnext/crm/doctype/lead/lead.py +++ b/erpnext/crm/doctype/lead/lead.py @@ -62,7 +62,8 @@ class Lead(SellingController): if self.contact_date and getdate(self.contact_date) < getdate(nowdate()): frappe.throw(_("Next Contact Date cannot be in the past")) - if self.ends_on and self.contact_date and (self.ends_on < self.contact_date): + if (self.ends_on and self.contact_date and + (getdate(self.ends_on) < getdate(self.contact_date))): frappe.throw(_("Ends On date cannot be before Next Contact Date.")) def on_update(self):