From 6a0eb61af3281a979b2d3e3dd175a5337963ae4f Mon Sep 17 00:00:00 2001 From: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com> Date: Thu, 22 Oct 2020 14:05:58 +0530 Subject: [PATCH] fix: Set customer only if contact is present (#23704) --- erpnext/communication/doctype/call_log/call_log.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/communication/doctype/call_log/call_log.py b/erpnext/communication/doctype/call_log/call_log.py index b31b757a376..296473efe1f 100644 --- a/erpnext/communication/doctype/call_log/call_log.py +++ b/erpnext/communication/doctype/call_log/call_log.py @@ -15,9 +15,9 @@ class CallLog(Document): number = strip_number(self.get('from')) self.contact = get_contact_with_phone_number(number) self.lead = get_lead_with_phone_number(number) - - contact = frappe.get_doc("Contact", self.contact) - self.customer = contact.get_link_for("Customer") + if self.contact: + contact = frappe.get_doc("Contact", self.contact) + self.customer = contact.get_link_for("Customer") def after_insert(self): self.trigger_call_popup()