1
0
forked from test/crm

fix: added default columns in listview

This commit is contained in:
Shariq Ansari 2024-01-26 16:34:45 +05:30
parent 1ed93a5a81
commit b261506559
2 changed files with 50 additions and 1 deletions

View File

@ -118,7 +118,8 @@ before_uninstall = "crm.uninstall.before_uninstall"
# Override standard doctype classes
override_doctype_class = {
"Contact": "crm.overrides.contact.CustomContact"
"Contact": "crm.overrides.contact.CustomContact",
"Email Template": "crm.overrides.email_template.CustomEmailTemplate",
}
# Document Events

View File

@ -0,0 +1,48 @@
# import frappe
from frappe import _
from frappe.email.doctype.email_template.email_template import EmailTemplate
class CustomEmailTemplate(EmailTemplate):
@staticmethod
def default_list_data():
columns = [
{
'label': 'Name',
'type': 'Data',
'key': 'name',
'width': '17rem',
},
{
'label': 'Subject',
'type': 'Data',
'key': 'subject',
'width': '12rem',
},
{
'label': 'Enabled',
'type': 'Check',
'key': 'enabled',
'width': '6rem',
},
{
'label': 'Doctype',
'type': 'Link',
'key': 'reference_doctype',
'width': '12rem',
},
{
'label': 'Last Modified',
'type': 'Datetime',
'key': 'modified',
'width': '8rem',
},
]
rows = [
"name",
"enabled",
"reference_doctype",
"subject",
"modified",
]
return {'columns': columns, 'rows': rows}