1
0
forked from test/crm

fix: customer not found error

This commit is contained in:
Shariq Ansari 2024-09-18 20:23:56 +05:30
parent 82d608b3e9
commit 64612c6863

View File

@ -102,7 +102,8 @@ def get_customer_link(crm_deal):
else:
client = get_erpnext_site_client(erpnext_crm_settings)
try:
customer = client.get_list("Customer", {"crm_deal": crm_deal})[0]["name"]
customer = client.get_list("Customer", {"crm_deal": crm_deal})
customer = customer[0].get("name") if len(customer) else None
if customer:
return f"{erpnext_crm_settings.erpnext_site_url}/app/customer/{customer}"
else: