fix: validate dot in numeric placeholders (#33739)

* fix: validate dot in numeric placeholders

* fix: failed test cases
This commit is contained in:
PUGAZHENDHI V 2025-08-25 11:58:43 +05:30 committed by GitHub
parent a812021809
commit 4c1a61f085
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -71,6 +71,14 @@ class NamingSeries:
exc=InvalidNamingSeriesError,
)
if "#" in self.series and ".#" not in self.series:
frappe.throw(
_(
"Invalid naming series {}: dot (.) missing before the numeric placeholders. Kindly use a format like <b>ABCD.#####</b>."
).format(frappe.bold(self.series)),
exc=InvalidNamingSeriesError,
)
def generate_next_name(self, doc: "Document", *, ignore_validate=False) -> str:
if not ignore_validate:
self.validate()