Przeglądaj źródła

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

version-14
Nabin Hait 8 lat temu
committed by Rushabh Mehta
rodzic
commit
2b54cd619d
1 zmienionych plików z 5 dodań i 9 usunięć
  1. +5
    -9
      frappe/email/doctype/email_account/email_account.py

+ 5
- 9
frappe/email/doctype/email_account/email_account.py Wyświetl plik

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


else: else:
frappe.db.commit() 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 #notify if user is linked to account
if len(incoming_mails)>0 and not frappe.local.flags.in_test: if len(incoming_mails)>0 and not frappe.local.flags.in_test:
@@ -342,12 +342,8 @@ class EmailAccount(Document):
if names: if names:
name = names[0].get("name") name = names[0].get("name")
# email is already available update communication uid instead # 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({ communication = frappe.get_doc({
"doctype": "Communication", "doctype": "Communication",


Ładowanie…
Anuluj
Zapisz