fix: '>' not supported between instances of 'int' and 'NoneType'

This commit is contained in:
Rohit Waghchaure 2020-05-03 20:46:21 +05:30
parent f713585e68
commit ee0e4e0a44

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