浏览代码

[fix] change subject in email alert, fixes frappe/erpnext#6361

version-14
Rushabh Mehta 8 年前
父节点
当前提交
059b7d7b70
共有 2 个文件被更改,包括 27 次插入3 次删除
  1. +24
    -3
      frappe/email/doctype/email_alert/email_alert.json
  2. +3
    -0
      frappe/email/doctype/email_alert/email_alert.py

+ 24
- 3
frappe/email/doctype/email_alert/email_alert.json 查看文件

@@ -2,17 +2,20 @@
"allow_copy": 0, "allow_copy": 0,
"allow_import": 0, "allow_import": 0,
"allow_rename": 0, "allow_rename": 0,
"autoname": "field:subject",
"autoname": "",
"beta": 0,
"creation": "2014-07-11 17:18:09.923399", "creation": "2014-07-11 17:18:09.923399",
"custom": 0, "custom": 0,
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"document_type": "System", "document_type": "System",
"editable_grid": 0,
"fields": [ "fields": [
{ {
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"default": "1", "default": "1",
"fieldname": "enabled", "fieldname": "enabled",
"fieldtype": "Check", "fieldtype": "Check",
@@ -38,6 +41,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"fieldname": "filters", "fieldname": "filters",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0, "hidden": 0,
@@ -62,6 +66,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"description": "To add dynamic subject, use jinja tags like\n\n<div><pre><code>{{ doc.name }} Delivered</code></pre></div>", "description": "To add dynamic subject, use jinja tags like\n\n<div><pre><code>{{ doc.name }} Delivered</code></pre></div>",
"fieldname": "subject", "fieldname": "subject",
"fieldtype": "Data", "fieldtype": "Data",
@@ -87,6 +92,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"fieldname": "document_type", "fieldname": "document_type",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0, "hidden": 0,
@@ -112,6 +118,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"fieldname": "event", "fieldname": "event",
"fieldtype": "Select", "fieldtype": "Select",
"hidden": 0, "hidden": 0,
@@ -137,6 +144,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.event==\"Days After\" || doc.event==\"Days Before\"", "depends_on": "eval:doc.event==\"Days After\" || doc.event==\"Days Before\"",
"description": "Send alert if date matches this field's value", "description": "Send alert if date matches this field's value",
"fieldname": "date_changed", "fieldname": "date_changed",
@@ -163,6 +171,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"default": "0", "default": "0",
"depends_on": "eval:doc.event==\"Days After\" || doc.event==\"Days Before\"", "depends_on": "eval:doc.event==\"Days After\" || doc.event==\"Days Before\"",
"description": "Send days before or after the reference date", "description": "Send days before or after the reference date",
@@ -190,6 +199,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.event==\"Value Change\"", "depends_on": "eval:doc.event==\"Value Change\"",
"description": "Send alert if this field's value changes", "description": "Send alert if this field's value changes",
"fieldname": "value_changed", "fieldname": "value_changed",
@@ -216,6 +226,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"fieldname": "section_break_9", "fieldname": "section_break_9",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0, "hidden": 0,
@@ -240,6 +251,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"depends_on": "", "depends_on": "",
"description": "Optional: The alert will be sent if this expression is true", "description": "Optional: The alert will be sent if this expression is true",
"fieldname": "condition", "fieldname": "condition",
@@ -266,6 +278,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"fieldname": "column_break_6", "fieldname": "column_break_6",
"fieldtype": "Column Break", "fieldtype": "Column Break",
"hidden": 0, "hidden": 0,
@@ -289,6 +302,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"fieldname": "html_7", "fieldname": "html_7",
"fieldtype": "HTML", "fieldtype": "HTML",
"hidden": 0, "hidden": 0,
@@ -313,6 +327,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"fieldname": "column_break_5", "fieldname": "column_break_5",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0, "hidden": 0,
@@ -337,6 +352,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"fieldname": "recipients", "fieldname": "recipients",
"fieldtype": "Table", "fieldtype": "Table",
"hidden": 0, "hidden": 0,
@@ -362,6 +378,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"fieldname": "message_sb", "fieldname": "message_sb",
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0, "hidden": 0,
@@ -386,6 +403,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"fieldname": "message", "fieldname": "message",
"fieldtype": "Text", "fieldtype": "Text",
"hidden": 0, "hidden": 0,
@@ -410,6 +428,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"fieldname": "attach_print", "fieldname": "attach_print",
"fieldtype": "Check", "fieldtype": "Check",
"hidden": 0, "hidden": 0,
@@ -435,6 +454,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"fieldname": "message_examples", "fieldname": "message_examples",
"fieldtype": "HTML", "fieldtype": "HTML",
"hidden": 0, "hidden": 0,
@@ -460,6 +480,7 @@
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0,
"fieldname": "view_properties", "fieldname": "view_properties",
"fieldtype": "Button", "fieldtype": "Button",
"hidden": 0, "hidden": 0,
@@ -486,6 +507,7 @@
"hide_toolbar": 0, "hide_toolbar": 0,
"icon": "icon-envelope", "icon": "icon-envelope",
"idx": 0, "idx": 0,
"image_view": 0,
"in_create": 0, "in_create": 0,
"in_dialog": 0, "in_dialog": 0,
"is_submittable": 0, "is_submittable": 0,
@@ -493,7 +515,7 @@
"istable": 0, "istable": 0,
"max_attachments": 0, "max_attachments": 0,
"menu_index": 0, "menu_index": 0,
"modified": "2016-05-02 06:16:05.453253",
"modified": "2016-09-16 06:29:18.577597",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Email", "module": "Email",
"name": "Email Alert", "name": "Email Alert",
@@ -521,7 +543,6 @@
"write": 1 "write": 1
} }
], ],

"quick_entry": 0, "quick_entry": 0,
"read_only": 0, "read_only": 0,
"read_only_onload": 0, "read_only_onload": 0,


+ 3
- 0
frappe/email/doctype/email_alert/email_alert.py 查看文件

@@ -10,6 +10,9 @@ from frappe.utils import validate_email_add, nowdate
from frappe.utils.jinja import validate_template from frappe.utils.jinja import validate_template


class EmailAlert(Document): class EmailAlert(Document):
def autoname(self):
self.name = self.subject

def validate(self): def validate(self):
validate_template(self.subject) validate_template(self.subject)
validate_template(self.message) validate_template(self.message)


正在加载...
取消
保存