Skip to content

Commit

Permalink
fix: check object instead of DB for amended_from field (#25645)
Browse files Browse the repository at this point in the history
  • Loading branch information
ankush committed Mar 26, 2024
1 parent 76096f5 commit 7f4bcf3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions frappe/core/doctype/doctype/doctype.py
Original file line number Diff line number Diff line change
Expand Up @@ -868,9 +868,7 @@ def export_types_to_controller(self):
def make_amendable(self):
"""If is_submittable is set, add amended_from docfields."""
if self.is_submittable:
docfield_exists = frappe.get_all(
"DocField", filters={"fieldname": "amended_from", "parent": self.name}, pluck="name", limit=1
)
docfield_exists = [f for f in self.fields if f.fieldname == "amended_from"]
if not docfield_exists:
self.append(
"fields",
Expand Down

0 comments on commit 7f4bcf3

Please sign in to comment.