Update frappe/integrations/doctype/google_contacts/google_contacts.py

Co-Authored-By: Faris Ansari <netchampfaris@users.noreply.github.com>
This commit is contained in:
Himanshu 2019-09-13 16:07:31 +05:30 committed by GitHub
parent 9366334fbd
commit 8dd559b9e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -231,7 +231,7 @@ def update_contacts_to_google_contacts(doc, method=None):
"""
# Workaround to avoid triggering updation when Event is being inserted since
# creation and modified are same when inserting doc
if not frappe.db.exists("Google Contacts", {"name": doc.google_contacts}) or doc.modified == doc.creation \
if not frappe.db.exists("Google Contacts", {"name": doc.google_contacts}) or doc.is_new() \
or not doc.sync_with_google_contacts:
return