From 853facad96410205b2ebf9b26e68c9085e2e6395 Mon Sep 17 00:00:00 2001 From: Shankarv19bcr Date: Mon, 26 Jan 2026 14:37:55 +0530 Subject: [PATCH] fix: strip whitespace in customer_name (cherry picked from commit e5ba0e640191c541745a579dd474a6a20b9257db) --- erpnext/selling/doctype/customer/customer.py | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py index 1c1ae08b280..7fb15943c9f 100644 --- a/erpnext/selling/doctype/customer/customer.py +++ b/erpnext/selling/doctype/customer/customer.py @@ -114,6 +114,7 @@ class Customer(TransactionBase): set_name_from_naming_options(frappe.get_meta(self.doctype).autoname, self) def get_customer_name(self): + self.customer_name = self.customer_name.strip() if frappe.db.get_value("Customer", self.customer_name) and not frappe.flags.in_import: count = frappe.db.sql( """select ifnull(MAX(CAST(SUBSTRING_INDEX(name, ' ', -1) AS UNSIGNED)), 0) from tabCustomer