fix: Doctype name which is tablename in database is limited to 64 characters
This commit is contained in:
parent
e43cf12941
commit
af5e9099dc
1 changed files with 6 additions and 0 deletions
|
|
@ -699,6 +699,12 @@ class DocType(Document):
|
|||
if not name:
|
||||
name = self.name
|
||||
|
||||
# a Doctype name is the tablename created in database
|
||||
# `tab<Doctype Name>` the length of tablename is limited to 64 characters
|
||||
if len(name) > (frappe.db.MAX_COLUMN_LENGTH - 3):
|
||||
# length(tab + <Doctype Name>) should be equal to 64 characters hence doctype should be 61 characters
|
||||
frappe.throw(_("Doctype name is limited to 61 characters ({0})").format(name))
|
||||
|
||||
flags = {"flags": re.ASCII}
|
||||
|
||||
# a DocType name should not start or end with an empty space
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue