From d443a80ad4f911bf055c1001a8b22b83ff602934 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Tue, 14 Apr 2026 11:24:43 +0530 Subject: [PATCH] fix(customize form): prevent setting standard fields as virtual --- frappe/custom/doctype/customize_form/customize_form.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frappe/custom/doctype/customize_form/customize_form.py b/frappe/custom/doctype/customize_form/customize_form.py index 472a80c6a7..b5c0c9b29a 100644 --- a/frappe/custom/doctype/customize_form/customize_form.py +++ b/frappe/custom/doctype/customize_form/customize_form.py @@ -401,6 +401,10 @@ class CustomizeForm(Document): elif prop == "in_global_search" and df.in_global_search != meta_df[0].get("in_global_search"): self.flags.rebuild_doctype_for_global_search = True + elif prop == "is_virtual" and meta_df[0].get("is_virtual") == 0 and df.get("is_virtual") == 1: + frappe.msgprint(_("You can't set standard field {0} as virtual").format(frappe.bold(df.label))) + return False + return True def set_property_setters_for_actions_and_links(self, meta):