diff --git a/crm/hooks.py b/crm/hooks.py index b8bc1e99..c60beac0 100644 --- a/crm/hooks.py +++ b/crm/hooks.py @@ -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 diff --git a/crm/overrides/email_template.py b/crm/overrides/email_template.py new file mode 100644 index 00000000..af7ed764 --- /dev/null +++ b/crm/overrides/email_template.py @@ -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}