fix: call popup get contact name from number
This commit is contained in:
		
							parent
							
								
									128f5dbff1
								
							
						
					
					
						commit
						9f4dc3fcd4
					
				| @ -1,6 +1,7 @@ | |||||||
| import frappe | import frappe | ||||||
| from frappe import _ | from frappe import _ | ||||||
| import json | import json | ||||||
|  | from frappe.contacts.doctype.contact.contact import get_contact_with_phone_number | ||||||
| 
 | 
 | ||||||
| @frappe.whitelist() | @frappe.whitelist() | ||||||
| def get_document_with_phone_number(number): | def get_document_with_phone_number(number): | ||||||
| @ -11,10 +12,10 @@ def get_document_with_phone_number(number): | |||||||
| 		'phone': ['like', '%{}'.format(number)], | 		'phone': ['like', '%{}'.format(number)], | ||||||
| 		'mobile_no': ['like', '%{}'.format(number)] | 		'mobile_no': ['like', '%{}'.format(number)] | ||||||
| 	} | 	} | ||||||
| 	contacts = frappe.get_all('Contact', or_filters=number_filter, limit=1) | 	contact = get_contact_with_phone_number(number) | ||||||
| 
 | 
 | ||||||
| 	if contacts: | 	if contact: | ||||||
| 		return frappe.get_doc('Contact', contacts[0].name) | 		return frappe.get_doc('Contact', contact) | ||||||
| 
 | 
 | ||||||
| 	leads = frappe.get_all('Lead', or_filters=number_filter, limit=1) | 	leads = frappe.get_all('Lead', or_filters=number_filter, limit=1) | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user