diff --git a/erpnext/patches/v11_0/refactor_naming_series.py b/erpnext/patches/v11_0/refactor_naming_series.py index 3a2cdbd8cde..d5af9399b0f 100644 --- a/erpnext/patches/v11_0/refactor_naming_series.py +++ b/erpnext/patches/v11_0/refactor_naming_series.py @@ -110,7 +110,7 @@ def get_series(): return series_to_set def get_series_to_preserve(doctype): - series_to_preserve = frappe.db.sql_list("""select distinct naming_series from `tab{doctype}`""".format(doctype=doctype)) + series_to_preserve = frappe.db.sql_list("""select distinct naming_series from `tab{doctype}` where ifnull(naming_series, '') != ''""".format(doctype=doctype)) series_to_preserve.sort() return series_to_preserve