From f9043511a8b7cfe3711d8bb63857eaa5026c1a39 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Sat, 15 Mar 2025 14:47:38 +0530 Subject: [PATCH] fix: get distinct deal contacts which has name --- crm/fcrm/doctype/crm_deal/api.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crm/fcrm/doctype/crm_deal/api.py b/crm/fcrm/doctype/crm_deal/api.py index 26a88ca6..9b5ee368 100644 --- a/crm/fcrm/doctype/crm_deal/api.py +++ b/crm/fcrm/doctype/crm_deal/api.py @@ -20,9 +20,13 @@ def get_deal_contacts(name): "CRM Contacts", filters={"parenttype": "CRM Deal", "parent": name}, fields=["contact", "is_primary"], + distinct=True, ) deal_contacts = [] for contact in contacts: + if not contact.contact: + continue + is_primary = contact.is_primary contact = frappe.get_doc("Contact", contact.contact).as_dict()