fix date compare in contact_date

This commit is contained in:
Faris Ansari 2017-02-27 21:51:33 +05:30
parent 72c7e73ce0
commit 0ded707397

View File

@ -4,8 +4,7 @@
from __future__ import unicode_literals from __future__ import unicode_literals
import frappe import frappe
from frappe import _ from frappe import _
from frappe.utils import (cstr, validate_email_add, cint, comma_and, has_gravatar, from frappe.utils import (cstr, validate_email_add, cint, comma_and, has_gravatar, now)
getdate, nowdate)
from frappe.model.mapper import get_mapped_doc from frappe.model.mapper import get_mapped_doc
from erpnext.controllers.selling_controller import SellingController from erpnext.controllers.selling_controller import SellingController
@ -46,7 +45,7 @@ class Lead(SellingController):
self.image = has_gravatar(self.email_id) 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")) frappe.throw(_("Next Contact Date cannot be in the past"))
def on_update(self): def on_update(self):