From 0ded707397a33bf76ed105a8354ab75e9c33ce12 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Mon, 27 Feb 2017 21:51:33 +0530 Subject: [PATCH] fix date compare in contact_date --- erpnext/crm/doctype/lead/lead.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/erpnext/crm/doctype/lead/lead.py b/erpnext/crm/doctype/lead/lead.py index c306cbffa9..e6659f3890 100644 --- a/erpnext/crm/doctype/lead/lead.py +++ b/erpnext/crm/doctype/lead/lead.py @@ -4,8 +4,7 @@ from __future__ import unicode_literals import frappe from frappe import _ -from frappe.utils import (cstr, validate_email_add, cint, comma_and, has_gravatar, - getdate, nowdate) +from frappe.utils import (cstr, validate_email_add, cint, comma_and, has_gravatar, now) from frappe.model.mapper import get_mapped_doc from erpnext.controllers.selling_controller import SellingController @@ -46,7 +45,7 @@ class Lead(SellingController): self.image = has_gravatar(self.email_id) - if self.contact_date and getdate(self.contact_date) < nowdate(): + if self.contact_date and self.contact_date < now(): frappe.throw(_("Next Contact Date cannot be in the past")) def on_update(self):