From a86a07ef37b3ccdbf4e10f0d6a2310705dfc87b8 Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Mon, 17 Jun 2019 09:29:46 +0530 Subject: [PATCH] fix: Add additional check to ensure doc_before save exists --- erpnext/communication/doctype/call_log/call_log.json | 5 +++-- erpnext/communication/doctype/call_log/call_log.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/erpnext/communication/doctype/call_log/call_log.json b/erpnext/communication/doctype/call_log/call_log.json index 3bc8dbaa0ac..c3d6d07fa54 100644 --- a/erpnext/communication/doctype/call_log/call_log.json +++ b/erpnext/communication/doctype/call_log/call_log.json @@ -75,10 +75,11 @@ { "fieldname": "medium", "fieldtype": "Data", - "label": "Medium" + "label": "Medium", + "read_only": 1 } ], - "modified": "2019-06-17 08:21:20.665441", + "modified": "2019-06-17 09:02:48.150383", "modified_by": "Administrator", "module": "Communication", "name": "Call Log", diff --git a/erpnext/communication/doctype/call_log/call_log.py b/erpnext/communication/doctype/call_log/call_log.py index 053470687bb..66f1064e584 100644 --- a/erpnext/communication/doctype/call_log/call_log.py +++ b/erpnext/communication/doctype/call_log/call_log.py @@ -15,5 +15,5 @@ class CallLog(Document): def on_update(self): doc_before_save = self.get_doc_before_save() - if doc_before_save.status in ['Ringing'] and self.status in ['Missed', 'Completed']: + if doc_before_save and doc_before_save.status in ['Ringing'] and self.status in ['Missed', 'Completed']: frappe.publish_realtime('call_{id}_disconnected'.format(id=self.id), self)