Skip to content

Commit

Permalink
fix: loosen validation on fetch from columns (#25247)
Browse files Browse the repository at this point in the history
Any existing DB column can work so no need to check for meta explicitly.

(cherry picked from commit 457654c)
  • Loading branch information
ankush authored and mergify[bot] committed Mar 6, 2024
1 parent d733fc2 commit 0c934de
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frappe/core/doctype/doctype/doctype.py
Original file line number Diff line number Diff line change
Expand Up @@ -1623,7 +1623,9 @@ def check_fetch_from(docfield):
doctype = link_df[0].options
fetch_from_doctype = frappe.get_meta(doctype)

if not fetch_from_doctype.get_field(source_fieldname):
if not frappe.db.has_column(doctype, source_fieldname) and not fetch_from_doctype.get_field(
source_fieldname
):
frappe.throw(
_("Fetch From for field {0} is invalid: {1} does not have a field {2}").format(
frappe.bold(fieldname), frappe.bold(doctype), frappe.bold(source_fieldname)
Expand Down

0 comments on commit 0c934de

Please sign in to comment.