FIxed typos and create_lead method

This commit is contained in:
Pranav Nachanekar 2019-09-23 14:38:22 +05:30
parent 83dee07420
commit a35e34b5f0

View File

@ -40,7 +40,7 @@ class Appointment(Document):
# Set status to unverified # Set status to unverified
self.status = 'Unverified' self.status = 'Unverified'
# Send email to confirm # Send email to confirm
verify_url = ''.join([frappe.utils.get_url(),'/book-appointment/verify?email=',self.customer_email,'&appoitnment=',self.name]) verify_url = ''.join([frappe.utils.get_url(),'/book-appointment/verify?email=',self.customer_email,'&appointment=',self.name])
message = ''.join(['Please click the following link to confirm your appointment:',verify_url]) message = ''.join(['Please click the following link to confirm your appointment:',verify_url])
frappe.sendmail(recipients=[self.customer_email], frappe.sendmail(recipients=[self.customer_email],
message=message, message=message,
@ -66,14 +66,14 @@ class Appointment(Document):
self.save(ignore_permissions=True) self.save(ignore_permissions=True)
frappe.db.commit() frappe.db.commit()
def create_lead(self,email): def create_lead(self):
# Return if already linked # Return if already linked
if self.lead: if self.lead:
return return
lead = frappe.get_doc({ lead = frappe.get_doc({
'doctype':'Lead', 'doctype':'Lead',
'lead_name':self.customer_name, 'lead_name':self.customer_name,
'email_id':email, 'email_id':self.customer_email,
'notes':self.customer_details, 'notes':self.customer_details,
'phone':self.customer_phone_number, 'phone':self.customer_phone_number,
}) })
@ -96,7 +96,7 @@ class Appointment(Document):
break break
def create_calendar_event(self): def create_calendar_event(self):
if self.appointment: if self.calendar_event:
return return
appointment_event = frappe.get_doc({ appointment_event = frappe.get_doc({
'doctype': 'Event', 'doctype': 'Event',