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.
This commit is contained in:
0xD0M1M0
2025-06-25 23:25:32 +02:00
committed by GitHub
parent 7181e67ad4
commit 1b18105bce

View File

@@ -327,7 +327,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")
address = get_default_address("Lead", source.name)
contact = get_default_contact("Lead", source.name)