fix: error when creating quotation from CRM (#54722)

This commit is contained in:
Mihir Kandoi
2026-05-04 21:11:09 +05:30
committed by GitHub
parent a68769565b
commit 2d3190effb

View File

@@ -572,7 +572,9 @@ def _make_customer(source_name, ignore_permissions=False):
if quotation.quotation_to == "Customer":
return frappe.get_doc("Customer", quotation.party_name)
elif quotation.quotation_to == "CRM Deal":
return frappe.get_doc("Customer", {"crm_deal": quotation.party_name})
customer_name = frappe.get_value("Customer", {"crm_deal": quotation.party_name})
if customer_name:
return frappe.get_doc("Customer", customer_name)
# Check if a Customer already exists for the Lead or Prospect.
existing_customer = None