diff --git a/core/doctype/communication/communication.py b/core/doctype/communication/communication.py index 856de7de2a..56366a6d6e 100644 --- a/core/doctype/communication/communication.py +++ b/core/doctype/communication/communication.py @@ -115,13 +115,9 @@ def set_lead_and_contact(d): "name") or None if not d.company: - if d.lead: - company = webnotes.conn.get_value("Lead", d.lead, "company") - elif d.contact: - company = webnotes.conn.get_value("Contact", d.contact, "company") + d.company = webnotes.conn.get_value("Lead", d.lead, "company") or \ + webnotes.conn.get_default("company") - d.company = company or webnotes.conn.get_default("company") - class DocType(): def __init__(self, doc, doclist=[]): self.doc = doc