Merge pull request #15199 from ruchamahabal/fix-fetch-from

fix: Allow Fetch From for a different link field of the same DocType
This commit is contained in:
mergify[bot] 2021-12-06 10:51:00 +00:00 committed by GitHub
commit bb1d3efc10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -143,11 +143,10 @@ frappe.ui.form.on("DocField", {
curr_value.doctype = doctype;
curr_value.fieldname = fieldname;
}
let curr_df_link_doctype = row.fieldtype == "Link" ? row.options : null;
let doctypes = frm.doc.fields
.filter(df => df.fieldtype == "Link")
.filter(df => df.options && df.options != curr_df_link_doctype)
.filter(df => df.options && df.fieldname != row.fieldname)
.map(df => ({
label: `${df.options} (${df.fieldname})`,
value: df.fieldname