From 5463a8b6cfe5f467b17c1a661c4426c29a36b67e Mon Sep 17 00:00:00 2001 From: 0xD0M1M0 <76812428+0xD0M1M0@users.noreply.github.com> Date: Wed, 25 Jun 2025 23:25:32 +0200 Subject: [PATCH] fix: customer_group import from lead to customer (#48266) In case customization happens and the lead has the field "customer_group", the get_mapped_doc function would fail and be overwritten by the default value. (cherry picked from commit 1b18105bce90b770264e741f8951708eb53b35e1) --- erpnext/crm/doctype/lead/lead.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/crm/doctype/lead/lead.py b/erpnext/crm/doctype/lead/lead.py index 44a919d8927..cf9a7f02f9d 100644 --- a/erpnext/crm/doctype/lead/lead.py +++ b/erpnext/crm/doctype/lead/lead.py @@ -323,7 +323,8 @@ def _make_customer(source_name, target_doc=None, ignore_permissions=False): target.customer_type = "Individual" target.customer_name = source.lead_name - target.customer_group = frappe.db.get_default("Customer Group") + if not target.customer_group: + target.customer_group = frappe.db.get_default("Customer Group") doclist = get_mapped_doc( "Lead",