fix: set link field to undefined instead of empty string

This breaks other code where undefined values are removed, technically
invalid value for link field => unset link field so it should be
undefined
This commit is contained in:
Ankush Menat 2021-12-15 18:41:56 +05:30
parent 5ee5573d21
commit b633f31bf4

View file

@ -471,7 +471,7 @@ frappe.ui.form.ControlLink = class ControlLink extends frappe.ui.form.ControlDat
docname: value,
fields: columns_to_fetch,
}).then((response) => {
if (!response || !response.name) return "";
if (!response || !response.name) return undefined;
if (!docname || !columns_to_fetch.length) return response.name;
for (const [target_field, source_field] of Object.entries(fetch_map)) {