fix(doctype): MySQL syntax for unique fields validation
This commit is contained in:
parent
e4022f7f03
commit
0baec957be
1 changed files with 1 additions and 1 deletions
|
|
@ -762,7 +762,7 @@ def validate_fields(meta):
|
|||
|
||||
if not d.get("__islocal") and frappe.db.has_column(d.parent, d.fieldname):
|
||||
has_non_unique_values = frappe.db.sql("""select `{fieldname}`, count(*)
|
||||
from `tab{doctype}` where ifnull({fieldname}, '') != ''
|
||||
from `tab{doctype}` where ifnull(`{fieldname}`, '') != ''
|
||||
group by `{fieldname}` having count(*) > 1 limit 1""".format(
|
||||
doctype=d.parent, fieldname=d.fieldname))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue