mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-23 15:09:20 +00:00
Merge pull request #52065 from frappe/mergify/bp/version-15-hotfix/pr-52064
fix: strip whitespace in customer_name (backport #52064)
This commit is contained in:
@@ -114,6 +114,7 @@ class Customer(TransactionBase):
|
|||||||
set_name_from_naming_options(frappe.get_meta(self.doctype).autoname, self)
|
set_name_from_naming_options(frappe.get_meta(self.doctype).autoname, self)
|
||||||
|
|
||||||
def get_customer_name(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:
|
if frappe.db.get_value("Customer", self.customer_name) and not frappe.flags.in_import:
|
||||||
count = frappe.db.sql(
|
count = frappe.db.sql(
|
||||||
"""select ifnull(MAX(CAST(SUBSTRING_INDEX(name, ' ', -1) AS UNSIGNED)), 0) from tabCustomer
|
"""select ifnull(MAX(CAST(SUBSTRING_INDEX(name, ' ', -1) AS UNSIGNED)), 0) from tabCustomer
|
||||||
|
|||||||
Reference in New Issue
Block a user