[fixes] [minor] email and doctype message
This commit is contained in:
parent
51f81bc362
commit
b05a6ef9b0
2 changed files with 10 additions and 11 deletions
|
|
@ -190,15 +190,8 @@ class EmailAccount(Document):
|
|||
parent = frappe.get_doc("Communication", in_reply_to)
|
||||
|
||||
if parent.reference_name:
|
||||
if self.append_to:
|
||||
# parent must reference only if name matches
|
||||
if parent.reference_doctype==self.append_to:
|
||||
# parent same as parent of last communication
|
||||
parent = frappe.get_doc(parent.reference_doctype,
|
||||
parent.reference_name)
|
||||
else:
|
||||
parent = frappe.get_doc(parent.reference_doctype,
|
||||
parent.reference_name)
|
||||
parent = frappe.get_doc(parent.reference_doctype,
|
||||
parent.reference_name)
|
||||
|
||||
if not parent and self.append_to and sender_field:
|
||||
if subject_field:
|
||||
|
|
|
|||
|
|
@ -234,7 +234,14 @@ class DbTable:
|
|||
query.append('alter column `{}` set default {}'.format(col.fieldname, col_default))
|
||||
|
||||
if query:
|
||||
frappe.db.sql("alter table `{}` {}".format(self.name, ", ".join(query)))
|
||||
try:
|
||||
frappe.db.sql("alter table `{}` {}".format(self.name, ", ".join(query)))
|
||||
except Exception, e:
|
||||
# sanitize
|
||||
if e.args[0]==1060:
|
||||
frappe.throw(str(e))
|
||||
else:
|
||||
raise e
|
||||
|
||||
class DbColumn:
|
||||
def __init__(self, table, fieldname, fieldtype, length, default,
|
||||
|
|
@ -469,4 +476,3 @@ def add_column(doctype, column_name, fieldtype, precision=None):
|
|||
frappe.db.commit()
|
||||
frappe.db.sql("alter table `tab%s` add column %s %s" % (doctype,
|
||||
column_name, get_definition(fieldtype, precision)))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue