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 1b18105bce)
This commit is contained in:
0xD0M1M0
2025-06-25 23:25:32 +02:00
committed by Mergify
parent b8a773e3e1
commit 5463a8b6cf

View File

@@ -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",