fix: Allow cancellation/rename of doctypes linked by a virtual custom field

This commit is contained in:
Andrew McLeod 2024-12-16 11:44:10 +00:00
parent d6adc3d7c2
commit 9469652fea

View file

@ -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")