-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update lead.py #8789
Update lead.py #8789
Conversation
Import datetime to compare next contact date with now()
What is the use case? |
resolves the below issue |
erpnext/crm/doctype/lead/lead.py
Outdated
@@ -45,7 +46,7 @@ def validate(self): | |||
|
|||
self.image = has_gravatar(self.email_id) | |||
|
|||
if self.contact_date and self.contact_date < now(): | |||
if self.contact_date and self.contact_date < datetime.now(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
datetime.now() can create problem with user date format.
Instead use nowdate()
function from frappe.utils
getdate(self.contact_date) < getdate(nowdate())
As per the suggestion from Nabin,instead of Datetime,getdate and nowdate from frappe.utils imported
* Update lead.py Import datetime to compare next contact date with now() * Update lead.py * Update lead.py As per the suggestion from Nabin,instead of Datetime,getdate and nowdate from frappe.utils imported
This reverts commit 9283377.
This reverts commit 9283377.
Import datetime to compare next contact date with now()