[minor] Added employees in Newsletter List

This commit is contained in:
Rushabh Mehta
2015-07-09 12:02:27 +05:30
parent 0910fc3b25
commit ccb9117ba5
2 changed files with 5 additions and 3 deletions

View File

@@ -12,8 +12,8 @@ from email.utils import parseaddr
class NewsletterList(Document): class NewsletterList(Document):
def onload(self): def onload(self):
singles = [d.name for d in frappe.db.get_all("DocType", "name", {"issingle": 1})] singles = [d.name for d in frappe.db.get_all("DocType", "name", {"issingle": 1})]
self.get("__onload").import_types = [d.parent \ self.get("__onload").import_types = [{"value": d.parent, "label": "{0} ({1})".format(d.parent, d.label)} \
for d in frappe.db.get_all("DocField", "parent", {"options": "Email"}) if d.parent not in singles] for d in frappe.db.get_all("DocField", ("parent", "label"), {"options": "Email"}) if d.parent not in singles]
def import_from(self, doctype): def import_from(self, doctype):
"""Extract email ids from given doctype and add them to the current list""" """Extract email ids from given doctype and add them to the current list"""

View File

@@ -290,6 +290,7 @@
"label": "Company Email", "label": "Company Email",
"oldfieldname": "company_email", "oldfieldname": "company_email",
"oldfieldtype": "Data", "oldfieldtype": "Data",
"options": "Email",
"permlevel": 0, "permlevel": 0,
"reqd": 0 "reqd": 0
}, },
@@ -385,6 +386,7 @@
"fieldname": "personal_email", "fieldname": "personal_email",
"fieldtype": "Data", "fieldtype": "Data",
"label": "Personal Email", "label": "Personal Email",
"options": "Email",
"permlevel": 0 "permlevel": 0
}, },
{ {
@@ -674,7 +676,7 @@
], ],
"icon": "icon-user", "icon": "icon-user",
"idx": 1, "idx": 1,
"modified": "2015-02-20 05:02:14.205144", "modified": "2015-07-09 02:25:20.987412",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "HR", "module": "HR",
"name": "Employee", "name": "Employee",