diff --git a/frappe/core/doctype/doctype/doctype.py b/frappe/core/doctype/doctype/doctype.py index 9d37849746..1aa6beb6a6 100644 --- a/frappe/core/doctype/doctype/doctype.py +++ b/frappe/core/doctype/doctype/doctype.py @@ -5,6 +5,7 @@ from __future__ import unicode_literals import re, copy, os, shutil import json +from frappe.cache_manager import clear_user_cache # imports - third party imports import six @@ -103,6 +104,10 @@ class DocType(Document): self.owner = 'Administrator' self.modified_by = 'Administrator' + def after_insert(self): + # clear user cache so that on the next reload this doctype is included in boot + clear_user_cache(frappe.session.user) + def set_default_in_list_view(self): '''Set default in-list-view for first 4 mandatory fields''' if not [d.fieldname for d in self.fields if d.in_list_view]: