From f1f6c911496c48286c9757031ee2bfe5ce617117 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Thu, 9 Nov 2023 21:56:26 +0530 Subject: [PATCH] fix: include contacts with deal --- crm/fcrm/doctype/crm_deal/api.py | 7 +++++++ crm/fcrm/doctype/crm_deal/crm_deal.json | 11 +++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/crm/fcrm/doctype/crm_deal/api.py b/crm/fcrm/doctype/crm_deal/api.py index 8f34ea33..6da46106 100644 --- a/crm/fcrm/doctype/crm_deal/api.py +++ b/crm/fcrm/doctype/crm_deal/api.py @@ -18,4 +18,11 @@ def get_deal(name): frappe.throw(_("Deal not found"), frappe.DoesNotExistError) deal = deal.pop() + + deal["contacts"] = frappe.get_all( + "CRM Contacts", + filters={"parenttype": "CRM Deal", "parent": deal.name}, + fields=["contact"], + ) + return deal diff --git a/crm/fcrm/doctype/crm_deal/crm_deal.json b/crm/fcrm/doctype/crm_deal/crm_deal.json index 41289ef0..1363f809 100644 --- a/crm/fcrm/doctype/crm_deal/crm_deal.json +++ b/crm/fcrm/doctype/crm_deal/crm_deal.json @@ -21,7 +21,8 @@ "column_break_bqvs", "contacts_tab", "email", - "mobile_no" + "mobile_no", + "contacts" ], "fields": [ { @@ -114,11 +115,17 @@ "options": "Qualification\nDemo/Making\nProposal/Quotation\nNegotiation\nReady to Close\nWon\nLost", "reqd": 1, "search_index": 1 + }, + { + "fieldname": "contacts", + "fieldtype": "Table", + "label": "Contacts", + "options": "CRM Contacts" } ], "index_web_pages_for_search": 1, "links": [], - "modified": "2023-11-06 21:53:50.442404", + "modified": "2023-11-09 19:58:15.620483", "modified_by": "Administrator", "module": "FCRM", "name": "CRM Deal",