Merge contacts-ref into contacts-ref

This commit is contained in:
Himanshu Warekar 2019-08-22 23:18:49 +05:30
commit cee2007f04

View file

@ -200,11 +200,11 @@ def get_contact_with_phone_number(number):
if not number: return
contacts = frappe.get_all('Contact Phone', filters=[
['phone', 'like', '{0}'.format(number)]
['phone', 'like', '%{0}'.format(number)]
], fields=["parent"], limit=1)
return contacts[0].parent if contacts else None
def get_contact_name(email_id):
contact = frappe.get_list("Contact Email", filters={"email_id": email_id}, fields=["parent"], limit=1)
return contact[0].parent if contact else None
return contact[0].parent if contact else None