Merge pull request #10218 from rohitwaghchaure/fixed-get_default_contact-issue

fix: '>' not supported between instances of 'int' and 'NoneType'
This commit is contained in:
mergify[bot] 2020-05-04 03:57:53 +00:00 committed by GitHub
commit 3f0ca5743f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -123,7 +123,7 @@ class Contact(Document):
def get_default_contact(doctype, name):
'''Returns default contact for the given doctype, name'''
out = frappe.db.sql('''select parent,
(select is_primary_contact from tabContact c where c.name = dl.parent)
IFNULL((select is_primary_contact from tabContact c where c.name = dl.parent), 0)
as is_primary_contact
from
`tabDynamic Link` dl