diff options
Diffstat (limited to 'odoo/tools')
| -rw-r--r-- | odoo/tools/cache.py | 4 | ||||
| -rw-r--r-- | odoo/tools/misc.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/odoo/tools/cache.py b/odoo/tools/cache.py index ac776eefa74..3703fc83ab1 100644 --- a/odoo/tools/cache.py +++ b/odoo/tools/cache.py @@ -217,8 +217,8 @@ def log_ormcache_stats(sig=None, frame=None): def get_cache_key_counter(bound_method, *args, **kwargs): """ Return the cache, key and stat counter for the given call. """ - model = bound_method.im_self - ormcache = bound_method.clear_cache.im_self + model = bound_method.__self__ + ormcache = bound_method.clear_cache.__self__ cache, key0, counter = ormcache.lru(model) key = key0 + ormcache.key(model, *args, **kwargs) return cache, key, counter diff --git a/odoo/tools/misc.py b/odoo/tools/misc.py index e0456a8429b..ebeb65c3523 100644 --- a/odoo/tools/misc.py +++ b/odoo/tools/misc.py @@ -471,7 +471,7 @@ class profile(object): def wrapper(*args, **kwargs): profile = cProfile.Profile() result = profile.runcall(f, *args, **kwargs) - profile.dump_stats(self.fname or ("%s.cprof" % (f.func_name,))) + profile.dump_stats(self.fname or ("%s.cprof" % (f.__name__,))) return result return wrapper |
