commit
8497784c4c
@ -189,9 +189,6 @@ class Account(Document):
|
||||
|
||||
def validate_trash(self):
|
||||
"""checks gl entries and if child exists"""
|
||||
if not self.parent_account:
|
||||
throw(_("Root account can not be deleted"))
|
||||
|
||||
if self.check_gle_exists():
|
||||
throw(_("Account with existing transaction can not be deleted"))
|
||||
if self.check_if_child_exists():
|
||||
|
@ -13,12 +13,14 @@ class NewsletterList(Document):
|
||||
def onload(self):
|
||||
singles = [d.name for d in frappe.db.get_all("DocType", "name", {"issingle": 1})]
|
||||
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", "label"), {"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):
|
||||
"""Extract email ids from given doctype and add them to the current list"""
|
||||
meta = frappe.get_meta(doctype)
|
||||
email_field = [d.fieldname for d in meta.fields if d.fieldtype in ("Data", "Small Text") and d.options=="Email"][0]
|
||||
email_field = [d.fieldname for d in meta.fields
|
||||
if d.fieldtype in ("Data", "Small Text", "Text", "Code") and d.options=="Email"][0]
|
||||
unsubscribed_field = "unsubscribed" if meta.get_field("unsubscribed") else None
|
||||
added = 0
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user