Odoo Help


how to solve " AttributeError: 'function' object has no attribute 'routing_type' " problem in Odoo

Piyush Suva
on 3/14/15, 3:49 AM 2,452 views

import openerp
from openerp.osv import fields, osv
from openerp import SUPERUSER_ID
from openerp.addons.web.controllers.main import DataSet
from openerp.addons.web import http
from openerp.addons.web.http import request
import json

original_call_kw = DataSet.call_kw

@http.route(['/web/dataset/call_kw', '/web/dataset/call_kw/<path:path>'], type='json', auth="user")
def call_kw(self, model, method, args, kwargs, path=None):
    fct_src = original_call_kw
    cr,uid, context= request.cr, request.uid, request.context
    print 'YYYYYYY..........',cr, uid
    return fct_src(self,model, method, args, kwargs)

DataSet.call_kw = call_kw


If you Add This code in any installed module' py it gives below traceback:

2015-02-14 07:31:18,244 6158 ERROR v8_test openerp.http: Exception during JSON request handling.
Traceback (most recent call last):
  File "/home/workspace/openerp/odoo/openerp/http.py", line 476, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/workspace/openerp/odoo/openerp/http.py", line 495, in dispatch
    result = self._call_function(**self.params)
  File "/home/workspace/openerp/odoo/openerp/http.py", line 311, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/home/workspace/openerp/odoo/openerp/service/model.py", line 113, in wrapper
    return f(dbname, *args, **kwargs)
  File "/home/serpentcs/workspace/openerp/odoo/openerp/http.py", line 308, in checked_call
    return self.endpoint(*a, **kw)
  File "/home/workspace/openerp/odoo/openerp/http.py", line 685, in __call__
    return self.method(*args, **kw)
  File "/home/workspace/openerp/odoo/openerp/http.py", line 361, in response_wrap
    if isinstance(response, Response) or f.routing_type == 'json':
AttributeError: 'function' object has no attribute 'routing_type'

 How to solve this problem?

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 3/14/15, 3:49 AM
Seen: 2452 times
Last updated: 7/12/17, 1:43 AM