Merge pull request #11412 from netchampfaris/fix-check-name-exists
fix: Also check if name is set, since empty object is truthy
This commit is contained in:
commit
63bab8166f
1 changed files with 1 additions and 1 deletions
|
|
@ -61,7 +61,7 @@ frappe.ui.form.ControlData = frappe.ui.form.ControlInput.extend({
|
|||
// check if name exists
|
||||
frappe.db.get_value(this.doctype, this.$input.val(),
|
||||
'name', (val) => {
|
||||
if (val) {
|
||||
if (val && val.name) {
|
||||
this.set_description(__('{0} already exists. Select another name', [val.name]));
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue