fix: validate dot in numeric placeholders (#33739)
* fix: validate dot in numeric placeholders * fix: failed test cases
This commit is contained in:
parent
a812021809
commit
4c1a61f085
1 changed files with 8 additions and 0 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue