diff --git a/webnotes/defaults.py b/webnotes/defaults.py index 8c9c0ba265..223d01803c 100644 --- a/webnotes/defaults.py +++ b/webnotes/defaults.py @@ -140,7 +140,7 @@ def get_defaults_for_match(userd): def clear_cache(parent=None): def all_profiles(): - return webnotes.conn.sql_list("select name from tabProfile") + ["Control Panel"] + return webnotes.conn.sql_list("select name from tabProfile") + ["Control Panel", "__global"] if parent=="Control Panel" or not parent: parent = all_profiles() diff --git a/webnotes/model/doc.py b/webnotes/model/doc.py index f0508ea1d0..2899b26cf7 100755 --- a/webnotes/model/doc.py +++ b/webnotes/model/doc.py @@ -380,6 +380,9 @@ class Document: res = webnotes.model.meta.get_dt_values(self.doctype, 'autoname, issingle, istable, name_case', as_dict=1) res = res and res[0] or {} + + doctypelist = webnotes.get_doctype(self.doctype) + res = doctypelist and doctypelist[0].fields or {} if new: self.fields["__islocal"] = 1 diff --git a/wnf.py b/wnf.py index 3b07522f9c..4e3e08b9ed 100755 --- a/wnf.py +++ b/wnf.py @@ -164,6 +164,8 @@ def setup_options(): help="clear web cache") parser.add_option("--clear_cache", default=False, action="store_true", help="clear cache") + parser.add_option("--clear_defaults", default=False, action="store_true", + help="clear cache of defaults") parser.add_option("--domain", metavar="DOMAIN", help="store domain in Website Settings", nargs=1) @@ -430,6 +432,11 @@ def run(): elif options.clear_cache: clear_cache() + elif options.clear_defaults: + import webnotes.defaults + webnotes.defaults.clear_cache() + webnotes.clear_cache() + elif options.append_future_import: append_future_import()