fix: Resolve value in promise while validating link field (backport #12925) (#12929)

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
This commit is contained in:
mergify[bot] 2021-04-20 22:26:34 +05:30 committed by GitHub
parent 09b0097e48
commit 96bfeb63c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -462,9 +462,10 @@ frappe.ui.form.ControlLink = frappe.ui.form.ControlData.extend({
if(this.frm && this.frm.fetch_dict[df.fieldname]) {
fetch = this.frm.fetch_dict[df.fieldname].columns.join(', ');
}
// if default and no fetch, no need to validate
if (!fetch && df.__default_value && df.__default_value===value) return value;
if (!fetch && df.__default_value && df.__default_value===value) {
resolve(value);
}
this.fetch_and_validate_link(resolve, df, doctype, docname, value, fetch);
});