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 27549c3b..8e0c1841 100644 --- a/crm/fcrm/doctype/crm_call_log/crm_call_log.py +++ b/crm/fcrm/doctype/crm_call_log/crm_call_log.py @@ -6,7 +6,86 @@ from frappe.model.document import Document class CRMCallLog(Document): - pass + @staticmethod + def sort_options(): + return [ + { "label": 'Created', "value": 'creation' }, + { "label": 'Modified', "value": 'modified' }, + { "label": 'Status', "value": 'status' }, + { "label": 'Type', "value": 'type' }, + { "label": 'Duration', "value": 'duration' }, + { "label": 'From', "value": 'from' }, + { "label": 'To', "value": 'to' }, + { "label": 'Caller', "value": 'caller' }, + { "label": 'Receiver', "value": 'receiver' }, + ] + + @staticmethod + def default_list_data(): + columns = [ + { + 'label': 'From', + 'type': 'Link', + 'key': 'caller', + 'options': 'User', + 'width': '9rem', + }, + { + 'label': 'To', + 'type': 'Link', + 'key': 'receiver', + 'options': 'User', + 'width': '9rem', + }, + { + 'label': 'Type', + 'type': 'Select', + 'key': 'type', + 'width': '9rem', + }, + { + 'label': 'Status', + 'type': 'Select', + 'key': 'status', + 'width': '9rem', + }, + { + 'label': 'Duration', + 'type': 'Duration', + 'key': 'duration', + 'width': '6rem', + }, + { + 'label': 'From (number)', + 'type': 'Data', + 'key': 'from', + 'width': '9rem', + }, + { + 'label': 'To (number)', + 'type': 'Data', + 'key': 'to', + 'width': '9rem', + }, + { + 'label': 'Created on', + 'type': 'Datetime', + 'key': 'creation', + 'width': '8rem', + }, + ] + rows = [ + "name", + "caller", + "receiver", + "type", + "status", + "duration", + "from", + "to", + "creation", + ] + return {'columns': columns, 'rows': rows} @frappe.whitelist() def get_call_log(name): diff --git a/frontend/src/components/ListViews/CallLogsListView.vue b/frontend/src/components/ListViews/CallLogsListView.vue new file mode 100644 index 00000000..4bbf2441 --- /dev/null +++ b/frontend/src/components/ListViews/CallLogsListView.vue @@ -0,0 +1,96 @@ + + diff --git a/frontend/src/pages/CallLogs.vue b/frontend/src/pages/CallLogs.vue index cfc2dec7..ee430ce0 100644 --- a/frontend/src/pages/CallLogs.vue +++ b/frontend/src/pages/CallLogs.vue @@ -6,74 +6,26 @@
- - + +
-
- - - - - - -
- {{ item.timeAgo }} -
-
- -
-
-
-
- -
+ :columns="callLogs.data.columns" + />