I am working in V8, and thus following the V8 API guide (https://media.readthedocs.org/pdf/odoo-new-api-guide-line/latest/odoo-new-api-guide-line.pdf) while trying to write a name_get function for my class. The PDF says that you only need "self" as a parameter, like this:
def do_something(self):
When I try to run it, though, I get this error:
Exception during JSON request handling.
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/openerp-8.0_8a9027e-py2.7.egg/openerp/http.py", line 500, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/usr/lib/python2.7/site-packages/openerp-8.0_8a9027e-py2.7.egg/openerp/http.py", line 517, in dispatch
result = self._call_function(**self.params)
File "/usr/lib/python2.7/site-packages/openerp-8.0_8a9027e-py2.7.egg/openerp/http.py", line 283, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/usr/lib/python2.7/site-packages/openerp-8.0_8a9027e-py2.7.egg/openerp/service/model.py", line 113, in wrapper
return f(dbname, *args, **kwargs)
File "/usr/lib/python2.7/site-packages/openerp-8.0_8a9027e-py2.7.egg/openerp/http.py", line 280, in checked_call
return self.endpoint(*a, **kw)
File "/usr/lib/python2.7/site-packages/openerp-8.0_8a9027e-py2.7.egg/openerp/http.py", line 733, in __call__
return self.method(*args, **kw)
File "/usr/lib/python2.7/site-packages/openerp-8.0_8a9027e-py2.7.egg/openerp/http.py", line 376, in response_wrap
response = f(*args, **kw)
File "/usr/lib/python2.7/site-packages/openerp-8.0_8a9027e-py2.7.egg/openerp/addons/web/controllers/main.py", line 944, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/usr/lib/python2.7/site-packages/openerp-8.0_8a9027e-py2.7.egg/openerp/addons/web/controllers/main.py", line 936, in _call_kw
return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
File "/usr/lib/python2.7/site-packages/openerp-8.0_8a9027e-py2.7.egg/openerp/api.py", line 237, in wrapper
return old_api(self, *args, **kwargs)
File "/usr/lib/python2.7/site-packages/openerp-8.0_8a9027e-py2.7.egg/openerp/api.py", line 332, in old_api
result = method(recs, *args, **kwargs)
File "/usr/lib/python2.7/site-packages/openerp-8.0_8a9027e-py2.7.egg/openerp/models.py", line 1754, in name_search
return self._name_search(name, args, operator, limit=limit)
File "/usr/lib/python2.7/site-packages/openerp-8.0_8a9027e-py2.7.egg/openerp/api.py", line 235, in wrapper
return new_api(self, *args, **kwargs)
File "/usr/lib/python2.7/site-packages/openerp-8.0_8a9027e-py2.7.egg/openerp/api.py", line 464, in new_api
result = method(self._model, cr, uid, *args, **kwargs)
File "/usr/lib/python2.7/site-packages/openerp-8.0_8a9027e-py2.7.egg/openerp/models.py", line 1767, in _name_search
res = self.name_get(cr, access_rights_uid, ids, context)
TypeError: name_get() takes exactly 1 argument (5 given)
Does that mean that Odoo is still trying to pass in 5 arguments, when it calls the name_get method?