diff --git a/frappe/public/js/frappe/form/controls/autocomplete.js b/frappe/public/js/frappe/form/controls/autocomplete.js index 27bf75e807..7b91a2031c 100644 --- a/frappe/public/js/frappe/form/controls/autocomplete.js +++ b/frappe/public/js/frappe/form/controls/autocomplete.js @@ -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; } diff --git a/frappe/website/doctype/web_form/web_form.py b/frappe/website/doctype/web_form/web_form.py index fd9949c45f..75f8793b4a 100644 --- a/frappe/website/doctype/web_form/web_form.py +++ b/frappe/website/doctype/web_form/web_form.py @@ -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(