From e27a662f712466c7298bd2bf5a65590a577b3760 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Wed, 22 Jan 2025 17:12:20 +0530 Subject: [PATCH] fix: do not update field value instead create copy of it and use on client side --- crm/fcrm/doctype/crm_call_log/crm_call_log.py | 10 +++++----- frontend/src/utils/callLog.js | 12 +++++++++++- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/crm/fcrm/doctype/crm_call_log/crm_call_log.py b/crm/fcrm/doctype/crm_call_log/crm_call_log.py index 6560aa8e..dd873e6d 100644 --- a/crm/fcrm/doctype/crm_call_log/crm_call_log.py +++ b/crm/fcrm/doctype/crm_call_log/crm_call_log.py @@ -97,7 +97,7 @@ class CRMCallLog(Document): def parse_call_log(call): call["show_recording"] = False - call["duration"] = seconds_to_duration(call.get("duration")) + call["_duration"] = seconds_to_duration(call.get("duration")) if call.get("type") == "Incoming": call["activity_type"] = "incoming_call" contact = get_contact_by_phone_number(call.get("from")) @@ -106,11 +106,11 @@ def parse_call_log(call): if call.get("receiver") else [None, None] ) - call["caller"] = { + call["_caller"] = { "label": contact.get("full_name", "Unknown"), "image": contact.get("image"), } - call["receiver"] = { + call["_receiver"] = { "label": receiver[0], "image": receiver[1], } @@ -122,11 +122,11 @@ def parse_call_log(call): if call.get("caller") else [None, None] ) - call["caller"] = { + call["_caller"] = { "label": caller[0], "image": caller[1], } - call["receiver"] = { + call["_receiver"] = { "label": contact.get("full_name", "Unknown"), "image": contact.get("image"), } diff --git a/frontend/src/utils/callLog.js b/frontend/src/utils/callLog.js index 2629d69b..4c989d6c 100644 --- a/frontend/src/utils/callLog.js +++ b/frontend/src/utils/callLog.js @@ -9,9 +9,19 @@ export function getCallLogDetail(row, log, columns = []) { if (row === 'duration') { return { - label: log.duration, + label: log._duration, icon: 'clock', } + } else if (row === 'caller') { + return { + label: log._caller.label, + image: log._caller.image, + } + } else if (row === 'receiver') { + return { + label: log._receiver.label, + image: log._receiver.image, + } } else if (row === 'type') { return { label: log.type,