diff --git a/frappe/custom/doctype/custom_field/custom_field.py b/frappe/custom/doctype/custom_field/custom_field.py index 40cca1cb15..8a7edfd319 100644 --- a/frappe/custom/doctype/custom_field/custom_field.py +++ b/frappe/custom/doctype/custom_field/custom_field.py @@ -47,7 +47,7 @@ class CustomField(Document): # update the schema if (self.fieldname not in frappe.db.get_table_columns(self.dt) - or self._old_fieldtype != self.fieldtype): + or getattr(self, "_old_fieldtype", None) != self.fieldtype): from frappe.model.db_schema import updatedb updatedb(self.dt)