瀏覽代碼

[fixes] [minor] email and doctype message

version-14
Rushabh Mehta 10 年之前
父節點
當前提交
b05a6ef9b0
共有 2 個檔案被更改,包括 10 行新增11 行删除
  1. +2
    -9
      frappe/email/doctype/email_account/email_account.py
  2. +8
    -2
      frappe/model/db_schema.py

+ 2
- 9
frappe/email/doctype/email_account/email_account.py 查看文件

@@ -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:


+ 8
- 2
frappe/model/db_schema.py 查看文件

@@ -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…
取消
儲存