diff --git a/crm/fcrm/doctype/crm_call_log/crm_call_log.json b/crm/fcrm/doctype/crm_call_log/crm_call_log.json index 96416bf9..cb7f91c2 100644 --- a/crm/fcrm/doctype/crm_call_log/crm_call_log.json +++ b/crm/fcrm/doctype/crm_call_log/crm_call_log.json @@ -47,8 +47,7 @@ "fieldname": "status", "fieldtype": "Select", "label": "Status", - "options": "Initiated\nRinging\nIn Progress\nCompleted\nFailed\nBusy\nNo Answer\nQueued\nCanceled", - "read_only": 1 + "options": "Initiated\nRinging\nIn Progress\nCompleted\nFailed\nBusy\nNo Answer\nQueued\nCanceled" }, { "fieldname": "start_time", @@ -83,8 +82,7 @@ "fieldname": "duration", "fieldtype": "Duration", "in_list_view": 1, - "label": "Duration", - "read_only": 1 + "label": "Duration" }, { "fieldname": "recording_url", @@ -145,7 +143,8 @@ "in_list_view": 1, "in_standard_filter": 1, "label": "Telephony Medium", - "options": "\nManual\nTwilio\nExotel" + "options": "\nManual\nTwilio\nExotel", + "read_only": 1 }, { "fieldname": "section_break_gyqe", @@ -154,7 +153,7 @@ ], "index_web_pages_for_search": 1, "links": [], - "modified": "2025-01-17 21:46:01.558377", + "modified": "2025-01-22 17:57:59.289548", "modified_by": "Administrator", "module": "FCRM", "name": "CRM Call Log", 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/crm/install.py b/crm/install.py index b0201d6d..1e0d816f 100644 --- a/crm/install.py +++ b/crm/install.py @@ -138,6 +138,10 @@ def add_default_fields_layout(force=False): "doctype": "Address", "layout": '[{"name": "details_section", "columns": [{"name": "column_uSSG", "fields": ["address_title", "address_type", "address_line1", "address_line2", "city", "state", "country", "pincode"]}]}]', }, + "CRM Call Log-Quick Entry": { + "doctype": "CRM Call Log", + "layout": '[{"name":"details_section","columns":[{"name":"column_uMSG","fields":["type","from","duration"]},{"name":"column_wiZT","fields":["to","status","caller","receiver"]}]}]', + }, } sidebar_fields_layouts = { diff --git a/crm/integrations/api.py b/crm/integrations/api.py index b440e629..c1c4e198 100644 --- a/crm/integrations/api.py +++ b/crm/integrations/api.py @@ -53,15 +53,17 @@ def add_note_to_call_log(call_sid, note): _note = frappe.get_doc( { "doctype": "FCRM Note", + "title": note.get("title", "Call Note"), "content": note.get("content"), } ).insert(ignore_permissions=True) - call_log = frappe.get_cached_doc("CRM Call Log", call_sid) - call_log.link_with_reference_doc("FCRM Note", _note.name) - call_log.save(ignore_permissions=True) else: _note = frappe.set_value("FCRM Note", note.get("name"), "content", note.get("content")) + call_log = frappe.get_cached_doc("CRM Call Log", call_sid) + call_log.link_with_reference_doc("FCRM Note", _note.name) + call_log.save(ignore_permissions=True) + return _note @@ -75,21 +77,30 @@ def add_task_to_call_log(call_sid, task): "doctype": "CRM Task", "title": task.get("title"), "description": task.get("description"), + "assigned_to": task.get("assigned_to"), + "due_date": task.get("due_date"), + "status": task.get("status"), + "priority": task.get("priority"), } ).insert(ignore_permissions=True) - call_log = frappe.get_doc("CRM Call Log", call_sid) - call_log.link_with_reference_doc("CRM Task", _task.name) - call_log.save(ignore_permissions=True) else: _task = frappe.get_doc("CRM Task", task.get("name")) _task.update( { "title": task.get("title"), "description": task.get("description"), + "assigned_to": task.get("assigned_to"), + "due_date": task.get("due_date"), + "status": task.get("status"), + "priority": task.get("priority"), } ) _task.save(ignore_permissions=True) + call_log = frappe.get_doc("CRM Call Log", call_sid) + call_log.link_with_reference_doc("CRM Task", _task.name) + call_log.save(ignore_permissions=True) + return _task diff --git a/crm/patches.txt b/crm/patches.txt index f8fbb4c6..f602b2bc 100644 --- a/crm/patches.txt +++ b/crm/patches.txt @@ -7,7 +7,7 @@ crm.patches.v1_0.rename_twilio_settings_to_crm_twilio_settings [post_model_sync] # Patches added in this section will be executed after doctypes are migrated crm.patches.v1_0.create_email_template_custom_fields -crm.patches.v1_0.create_default_fields_layout #10/12/2024 +crm.patches.v1_0.create_default_fields_layout #22/01/2025 crm.patches.v1_0.create_default_sidebar_fields_layout crm.patches.v1_0.update_deal_quick_entry_layout crm.patches.v1_0.update_layouts_to_new_format diff --git a/crm/patches/v1_0/create_default_fields_layout.py b/crm/patches/v1_0/create_default_fields_layout.py index 383e7ac2..4f460478 100644 --- a/crm/patches/v1_0/create_default_fields_layout.py +++ b/crm/patches/v1_0/create_default_fields_layout.py @@ -1,5 +1,5 @@ - from crm.install import add_default_fields_layout + def execute(): - add_default_fields_layout() \ No newline at end of file + add_default_fields_layout() diff --git a/frappe-ui b/frappe-ui index 863eaae9..aea80633 160000 --- a/frappe-ui +++ b/frappe-ui @@ -1 +1 @@ -Subproject commit 863eaae9ada2edb287fc09fb21d05212bb5eebe9 +Subproject commit aea806331c179cc0cdb89b6a2f9de2130bd1061f diff --git a/frontend/src/components/Activities/CallArea.vue b/frontend/src/components/Activities/CallArea.vue index d2689580..ba54557e 100644 --- a/frontend/src/components/Activities/CallArea.vue +++ b/frontend/src/components/Activities/CallArea.vue @@ -1,14 +1,14 @@ - + @@ -89,7 +92,12 @@ - + + diff --git a/frontend/src/components/Modals/CallLogDetailModal.vue b/frontend/src/components/Modals/CallLogDetailModal.vue new file mode 100644 index 00000000..3995e0f0 --- /dev/null +++ b/frontend/src/components/Modals/CallLogDetailModal.vue @@ -0,0 +1,372 @@ + + + + + diff --git a/frontend/src/components/Modals/CallLogModal.vue b/frontend/src/components/Modals/CallLogModal.vue index fb8ec499..b578f679 100644 --- a/frontend/src/components/Modals/CallLogModal.vue +++ b/frontend/src/components/Modals/CallLogModal.vue @@ -1,245 +1,212 @@ {{ __('No {0} Found', [__('Logs')]) }} - + + diff --git a/frontend/src/pages/Contact.vue b/frontend/src/pages/Contact.vue index ea386e40..92f919a1 100644 --- a/frontend/src/pages/Contact.vue +++ b/frontend/src/pages/Contact.vue @@ -227,9 +227,7 @@ const _address = ref({}) const contact = createResource({ url: 'crm.api.contact.get_contact', cache: ['contact', props.contactId], - params: { - name: props.contactId, - }, + params: { name: props.contactId }, auto: true, transform: (data) => { return { @@ -340,7 +338,7 @@ const sections = createResource({ cache: ['sidePanelSections', 'Contact'], params: { doctype: 'Contact' }, auto: true, - transform: (data) => getParsedSections(data), + transform: (data) => computed(() => getParsedSections(data)), }) function getParsedSections(_sections) { diff --git a/frontend/src/pages/MobileContact.vue b/frontend/src/pages/MobileContact.vue index dc6dcfff..a3caf365 100644 --- a/frontend/src/pages/MobileContact.vue +++ b/frontend/src/pages/MobileContact.vue @@ -320,9 +320,7 @@ const tabs = [ const deals = createResource({ url: 'crm.api.contact.get_linked_deals', cache: ['deals', props.contactId], - params: { - contact: props.contactId, - }, + params: { contact: props.contactId }, auto: true, }) @@ -337,7 +335,7 @@ const sections = createResource({ cache: ['sidePanelSections', 'Contact'], params: { doctype: 'Contact' }, auto: true, - transform: (data) => getParsedSections(data), + transform: (data) => computed(() => getParsedSections(data)), }) function getParsedSections(_sections) { diff --git a/frontend/src/utils/callLog.js b/frontend/src/utils/callLog.js index 2629d69b..0a64eb32 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,