ERPNext Foundation ERPNext Cloud User Manual Blog Discuss Frappé* Donate

Error when trying to add 3 Tables to a custom doctype


#1

I think it is a bug in all of v11.1.X because I get it on my live system (11.1.22) & (11.1.23) and also in a brand new build I made today (11.1.36).

Just create a new custom doctype and add 2 tables. Save. Try to add a 3rd table then save and you get an error.

ProgrammingError: (1064, u"You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘)’ at line 4")

File “/home/erpnextuser/frappe-bench/apps/frappe/frappe/database.py”, line 199, in sql
{
“e”: “(1064, u"You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘)’ at line 4”)",
“as_utf8”: 0,
“explain”: false,
“as_dict”: true,
“update”: null,
“formatted”: 0,
“ignore_ddl”: 0,
“as_list”: 0,
“query”: “delete from\n\t\t\t\ttabCustom Field\n\t\t\twhere\n\t\t\t\t dt = %s and fieldname in ()\n\t\t”,
“debug”: 0,
“values”: [
“Property Rate”
],
“auto_commit”: 0,
“self”: “”
}

Property Rate is the name of my doctype, I don’t have a custom field called Property Rate in the system.


#2

I can confirm now that this only occurs if there are no other fields on the doctype. My example I have 3 sections and under each 3 tables. It cannot save.

So the work around is to add a simple data field, hide it and then the doctype saves without issue.


#3

@mbuffi82,

If the problem confirmed, it will be better to create a github issue and track it. The community will really appreciate that…

Thank you.