Browse Source

Update only UID of email on communication if existing (#3266)

version-14
Nabin Hait 8 years ago
committed by Rushabh Mehta
parent
commit
2b54cd619d
1 changed files with 5 additions and 9 deletions
  1. +5
    -9
      frappe/email/doctype/email_account/email_account.py

+ 5
- 9
frappe/email/doctype/email_account/email_account.py View File

@@ -282,9 +282,9 @@ class EmailAccount(Document):

else:
frappe.db.commit()
attachments = [d.file_name for d in communication._attachments]
communication.notify(attachments=attachments, fetched_from_email_account=True)
if communication:
attachments = [d.file_name for d in communication._attachments]
communication.notify(attachments=attachments, fetched_from_email_account=True)

#notify if user is linked to account
if len(incoming_mails)>0 and not frappe.local.flags.in_test:
@@ -342,12 +342,8 @@ class EmailAccount(Document):
if names:
name = names[0].get("name")
# email is already available update communication uid instead
communication = frappe.get_doc("Communication", name)
communication.uid = uid
communication.save(ignore_permissions=True)
communication._attachments = []

return communication
frappe.db.set_value("Communication", name, "uid", uid)
return

communication = frappe.get_doc({
"doctype": "Communication",


Loading…
Cancel
Save