diff --git a/frappe/core/doctype/custom_field/custom_field.py b/frappe/core/doctype/custom_field/custom_field.py index 852786f914..a0e27b5953 100644 --- a/frappe/core/doctype/custom_field/custom_field.py +++ b/frappe/core/doctype/custom_field/custom_field.py @@ -3,7 +3,7 @@ from __future__ import unicode_literals import frappe -from frappe.utils import cint, cstr +from frappe.utils import cstr from frappe import _ from frappe.model.document import Document @@ -30,12 +30,12 @@ class CustomField(Document): frappe.throw(_("Fieldname not set for Custom Field")) def on_update(self): - # validate field - from frappe.core.doctype.doctype.doctype import validate_fields_for_doctype - frappe.clear_cache(doctype=self.dt) - validate_fields_for_doctype(self.dt) + if not self.ignore_validate: + # validate field + from frappe.core.doctype.doctype.doctype import validate_fields_for_doctype + validate_fields_for_doctype(self.dt) # create property setter to emulate insert after self.create_property_setter() diff --git a/frappe/core/doctype/customize_form/customize_form.py b/frappe/core/doctype/customize_form/customize_form.py index e65023400e..0f92b0c996 100644 --- a/frappe/core/doctype/customize_form/customize_form.py +++ b/frappe/core/doctype/customize_form/customize_form.py @@ -167,6 +167,7 @@ class CustomizeForm(Document): changed = True if changed: + custom_field.ignore_validate = True custom_field.save() def delete_custom_fields(self):