diff --git a/crm/api/doc.py b/crm/api/doc.py
index 9a89fbd6f..87b0c9fbb 100644
--- a/crm/api/doc.py
+++ b/crm/api/doc.py
@@ -1,5 +1,6 @@
import frappe
from frappe.model.document import get_controller
+from frappe.model import no_value_fields
from pypika import Criterion
@@ -77,22 +78,30 @@ def get_list_data(doctype: str, filters: dict, order_by: str):
page_length=20,
) or []
- not_allowed_fieldtypes = [
- "Section Break",
- "Column Break",
- "Tab Break",
- ]
-
fields = frappe.get_meta(doctype).fields
- fields = [field for field in fields if field.fieldtype not in not_allowed_fieldtypes]
- fields = [{"label": field.label, "value": field.fieldname} for field in fields if field.label and field.fieldname]
+ fields = [field for field in fields if field.fieldtype not in no_value_fields]
+ fields = [
+ {
+ "label": field.label,
+ "type": field.fieldtype,
+ "value": field.fieldname,
+ "options": field.options,
+ }
+ for field in fields
+ if field.label and field.fieldname
+ ]
std_fields = [
- {'label': 'Name', 'value': 'name'},
- {'label': 'Created On', 'value': 'creation'},
- {'label': 'Last Modified', 'value': 'modified'},
- {'label': 'Modified By', 'value': 'modified_by'},
- {'label': 'Owner', 'value': 'owner'},
+ {"label": "Name", "type": "Data", "value": "name"},
+ {"label": "Created On", "type": "Datetime", "value": "creation"},
+ {"label": "Last Modified", "type": "Datetime", "value": "modified"},
+ {
+ "label": "Modified By",
+ "type": "Link",
+ "value": "modified_by",
+ "options": "User",
+ },
+ {"label": "Owner", "type": "Link", "value": "owner", "options": "User"},
]
for field in std_fields:
diff --git a/crm/fcrm/doctype/crm_deal/crm_deal.py b/crm/fcrm/doctype/crm_deal/crm_deal.py
index 05280a149..7774eb3c7 100644
--- a/crm/fcrm/doctype/crm_deal/crm_deal.py
+++ b/crm/fcrm/doctype/crm_deal/crm_deal.py
@@ -62,36 +62,45 @@ def default_list_data():
columns = [
{
'label': 'Organization',
+ 'type': 'Link',
'key': 'organization',
+ 'options': 'CRM Organization',
'width': '11rem',
},
{
'label': 'Amount',
+ 'type': 'Currency',
'key': 'annual_revenue',
'width': '9rem',
},
{
'label': 'Status',
+ 'type': 'Select',
'key': 'status',
'width': '10rem',
},
{
'label': 'Email',
+ 'type': 'Data',
'key': 'email',
'width': '12rem',
},
{
'label': 'Mobile no',
+ 'type': 'Data',
'key': 'mobile_no',
'width': '11rem',
},
{
'label': 'Deal owner',
+ 'type': 'Link',
'key': 'deal_owner',
+ 'options': 'User',
'width': '10rem',
},
{
'label': 'Last modified',
+ 'type': 'Datetime',
'key': 'modified',
'width': '8rem',
},
diff --git a/crm/fcrm/doctype/crm_lead/crm_lead.py b/crm/fcrm/doctype/crm_lead/crm_lead.py
index 53cc570ec..98c8e4c46 100644
--- a/crm/fcrm/doctype/crm_lead/crm_lead.py
+++ b/crm/fcrm/doctype/crm_lead/crm_lead.py
@@ -141,36 +141,45 @@ def default_list_data():
columns = [
{
'label': 'Name',
+ 'type': 'Data',
'key': 'lead_name',
'width': '12rem',
},
{
'label': 'Organization',
+ 'type': 'Link',
'key': 'organization',
+ 'options': 'CRM Organization',
'width': '10rem',
},
{
'label': 'Status',
+ 'type': 'Select',
'key': 'status',
'width': '8rem',
},
{
'label': 'Email',
+ 'type': 'Data',
'key': 'email',
'width': '12rem',
},
{
'label': 'Mobile no',
+ 'type': 'Data',
'key': 'mobile_no',
'width': '11rem',
},
{
'label': 'Lead owner',
+ 'type': 'Link',
'key': 'lead_owner',
+ 'options': 'User',
'width': '10rem',
},
{
'label': 'Last modified',
+ 'type': 'Datetime',
'key': 'modified',
'width': '8rem',
},
diff --git a/crm/overrides/contact.py b/crm/overrides/contact.py
index 0cf250a03..64c2cc8bd 100644
--- a/crm/overrides/contact.py
+++ b/crm/overrides/contact.py
@@ -22,26 +22,31 @@ def default_list_data():
columns = [
{
'label': 'Name',
+ 'type': 'Data',
'key': 'full_name',
'width': '17rem',
},
{
'label': 'Email',
+ 'type': 'Data',
'key': 'email_id',
'width': '12rem',
},
{
'label': 'Phone',
+ 'type': 'Data',
'key': 'mobile_no',
'width': '12rem',
},
{
'label': 'Organization',
+ 'type': 'Data',
'key': 'company_name',
'width': '12rem',
},
{
'label': 'Last modified',
+ 'type': 'Datetime',
'key': 'modified',
'width': '8rem',
},
diff --git a/frontend/src/components/ListViews/ContactsListView.vue b/frontend/src/components/ListViews/ContactsListView.vue
index 9540cc052..e73701bd1 100644
--- a/frontend/src/components/ListViews/ContactsListView.vue
+++ b/frontend/src/components/ListViews/ContactsListView.vue
@@ -3,7 +3,10 @@
:columns="columns"
:rows="rows"
:options="{
- getRowRoute: (row) => ({ name: 'Contact', params: { contactId: row.name } }),
+ getRowRoute: (row) => ({
+ name: 'Contact',
+ params: { contactId: row.name },
+ }),
selectable: options.selectable,
}"
row-key="name"
@@ -41,9 +44,20 @@