Skip to content

Commit

Permalink
fix: customer not found error
Browse files Browse the repository at this point in the history
  • Loading branch information
shariquerik committed Sep 18, 2024
1 parent 82d608b commit 64612c6
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 64612c6

Please sign in to comment.