From 9469652fea0d7878d6a9312dcd53f7c2cd007461 Mon Sep 17 00:00:00 2001 From: Andrew McLeod Date: Mon, 16 Dec 2024 11:44:10 +0000 Subject: [PATCH] fix: Allow cancellation/rename of doctypes linked by a virtual custom field --- frappe/model/rename_doc.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frappe/model/rename_doc.py b/frappe/model/rename_doc.py index 62eebe3577..d1dcbafeab 100644 --- a/frappe/model/rename_doc.py +++ b/frappe/model/rename_doc.py @@ -509,6 +509,8 @@ def get_link_fields(doctype: str) -> list[dict]: ) if virtual_doctypes: custom_fields = custom_fields.where(cf.dt.notin(virtual_doctypes)) + if frappe.db.has_column("Custom Field", "is_virtual"): + custom_fields = custom_fields.where(cf.is_virtual == 0) custom_fields = custom_fields.run(as_dict=True) ps_issingle = frappe.qb.from_(dt).select(dt.issingle).where(dt.name == ps.doc_type).as_("issingle")