Merge pull request #21504 from frappe/fix-autoincrement-link-web-form
fix(WebForm): auto-increment link field
This commit is contained in:
commit
2fa7f8350c
2 changed files with 10 additions and 1 deletions
|
|
@ -174,6 +174,15 @@ frappe.ui.form.ControlAutocomplete = class ControlAutoComplete extends frappe.ui
|
|||
if (typeof options[0] === "string") {
|
||||
options = options.map((o) => ({ label: o, value: o }));
|
||||
}
|
||||
|
||||
options = options.map((o) => {
|
||||
if (typeof o !== "string") {
|
||||
o.label = o.label.toString();
|
||||
o.value = o.value.toString();
|
||||
}
|
||||
return o;
|
||||
});
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -631,7 +631,7 @@ def get_link_options(web_form_name, doctype, allow_read_on_all_link_options=Fals
|
|||
if title_field and show_title_field_in_link:
|
||||
return json.dumps(link_options, default=str)
|
||||
else:
|
||||
return "\n".join([doc.value for doc in link_options])
|
||||
return "\n".join([str(doc.value) for doc in link_options])
|
||||
|
||||
else:
|
||||
raise frappe.PermissionError(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue