diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py index dcdf4adcd35..fbaec574b7f 100644 --- a/erpnext/selling/doctype/quotation/quotation.py +++ b/erpnext/selling/doctype/quotation/quotation.py @@ -565,7 +565,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