From be2dea0ba2f108f388e39e316d95d4a83442a1a3 Mon Sep 17 00:00:00 2001 From: diptanilsaha Date: Thu, 13 Aug 2026 22:44:23 +0530 Subject: [PATCH] fix(crm_settings): create custom fields for Frappe CRM on enabling synchronization --- erpnext/crm/doctype/crm_settings/crm_settings.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/erpnext/crm/doctype/crm_settings/crm_settings.py b/erpnext/crm/doctype/crm_settings/crm_settings.py index 81d0072c4bd..6e974b2b476 100644 --- a/erpnext/crm/doctype/crm_settings/crm_settings.py +++ b/erpnext/crm/doctype/crm_settings/crm_settings.py @@ -69,6 +69,13 @@ class CRMSettings(Document): self.allowed_users = [] def custom_fields_for_frappe_crm_data_sync(self): + custom_fields = self.get_frappe_crm_custom_fields() + + if self.enable_frappe_crm_data_synchronization: + create_custom_fields(custom_fields, ignore_validate=True) + + @staticmethod + def get_frappe_crm_custom_fields(): custom_fields = { "Quotation": [ { @@ -88,4 +95,4 @@ class CRMSettings(Document): ], } - create_custom_fields(custom_fields, ignore_validate=True) + return custom_fields