From 809feb9c0409e5a658082c88175342ce2f4b74f4 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 4 May 2026 21:30:02 +0530 Subject: [PATCH] fix: error when creating quotation from CRM (backport #54722) (#54724) fix: error when creating quotation from CRM (#54722) (cherry picked from commit 2d3190effb92e88f7383006e695a91e3db633a6e) Co-authored-by: Mihir Kandoi --- erpnext/selling/doctype/quotation/quotation.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py index 2f70260a68a..d1a61ad34a3 100644 --- a/erpnext/selling/doctype/quotation/quotation.py +++ b/erpnext/selling/doctype/quotation/quotation.py @@ -560,7 +560,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