From 57e47cd93d07a879b94dfd6e9dad812f64bbcc2c Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 2 Sep 2013 18:45:11 +0530 Subject: [PATCH] [communication] [minor] --- selling/doctype/lead/get_leads.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/selling/doctype/lead/get_leads.py b/selling/doctype/lead/get_leads.py index 91ffd700702..3305a3b9f6e 100644 --- a/selling/doctype/lead/get_leads.py +++ b/selling/doctype/lead/get_leads.py @@ -12,9 +12,6 @@ def add_sales_communication(subject, content, sender, real_name, mail=None, lead_name = webnotes.conn.get_value("Lead", {"email_id": sender}) contact_name = webnotes.conn.get_value("Contact", {"email_id": sender}) - parent_doctype = "Contact" if contact_name else "Lead" - parent_name = contact_name or lead_name - if not (lead_name or contact_name): # none, create a new Lead lead = webnotes.bean({ @@ -28,6 +25,9 @@ def add_sales_communication(subject, content, sender, real_name, mail=None, lead.insert() lead_name = lead.doc.name + parent_doctype = "Contact" if contact_name else "Lead" + parent_name = contact_name or lead_name + message = make(content=content, sender=sender, subject=subject, doctype = parent_doctype, name = parent_name, date=date)