diff options
| author | xmo-odoo <xmo@odoo.com> | 2017-04-24 15:19:55 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-04-24 15:19:55 +0200 |
| commit | 90645ad3922c1b20e0e4882a5dee0e254bb6f4e4 (patch) | |
| tree | 5918da9b18a0c3659f1373dbe3966f4e09a3bdda /odoo/http.py | |
| parent | 95702929b185372128c4bfb1d6f09a15b0479dd0 (diff) | |
[FIX] function introspection attributes
Introspection attributes on function and methods were originally
prefixed with func_ or im_ e.g. im_class or func_name. For coherence with the
rest of the data model, Python 3 added dunder attributes (__func__,
__code__) and removed the old style, the dunder attributes were
backported to Python 2.6.
Use dunder attributes everywhere we're currently using func_* or im_*
attributes.
Fixers:
lib2to3.fixes.fix_funcattrs
lib2to3.fixes.fix_methodattrs
#8530
Diffstat (limited to 'odoo/http.py')
| -rw-r--r-- | odoo/http.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/odoo/http.py b/odoo/http.py index 015c00342b4..a8dbf098576 100644 --- a/odoo/http.py +++ b/odoo/http.py @@ -966,8 +966,8 @@ def routing_map(modules, nodb_only, converters=None): routing = dict(type='http', auth='user', methods=None, routes=None) methods_done = list() # update routing attributes from subclasses(auth, methods...) - for claz in reversed(mv.im_class.mro()): - fn = getattr(claz, mv.func_name, None) + for claz in reversed(mv.__self__.__class__.mro()): + fn = getattr(claz, mv.__name__, None) if fn and hasattr(fn, 'routing') and fn not in methods_done: methods_done.append(fn) routing.update(fn.routing) |
