Skip to content

Commit

Permalink
fix: Skip virtual doctype rename for dynamic links (#25479) (#25480)
Browse files Browse the repository at this point in the history
(cherry picked from commit ce124d8)

Co-authored-by: Ankush Menat <ankush@frappe.io>
  • Loading branch information
mergify[bot] and ankush committed Mar 15, 2024
1 parent c423223 commit f368236
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion frappe/model/rename_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,10 @@ def rename_dynamic_links(doctype: str, old: str, new: str):
Singles = frappe.qb.DocType("Singles")
for df in get_dynamic_link_map().get(doctype, []):
# dynamic link in single, just one value to check
if frappe.get_meta(df.parent).issingle:
meta = frappe.get_meta(df.parent)
if meta.is_virtual:
continue
if meta.issingle:
refdoc = frappe.db.get_singles_dict(df.parent)
if refdoc.get(df.options) == doctype and refdoc.get(df.fieldname) == old:
frappe.qb.update(Singles).set(Singles.value, new).where(
Expand Down

0 comments on commit f368236

Please sign in to comment.