fix: strip whitespace in customer_name

(cherry picked from commit e5ba0e6401)
This commit is contained in:
Shankarv19bcr
2026-01-26 14:37:55 +05:30
committed by Mergify
parent 636e1ac1f1
commit 853facad96

View File

@@ -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