Odoo Help


TypeError: _get_category() takes exactly 6 arguments (4 given)

on 12/18/15, 1:50 AM 939 views

What exactly is Wrong?

I am trying to run the code and i am getting below error:

Server Traceback (most recent call last):
  File "C:\Program Files (x86)\OpenERP 7.0-20141009-011214\server\openerp\addons\web\session.py", line 89, in send
  File "C:\Program Files (x86)\OpenERP 7.0-20141009-011214\server\.\openerp\netsvc.py", line 296, in dispatch_rpc
  File "C:\Program Files (x86)\OpenERP 7.0-20141009-011214\server\.\openerp\service\web_services.py", line 626, in dispatch
  File "C:\Program Files (x86)\OpenERP 7.0-20141009-011214\server\.\openerp\osv\osv.py", line 190, in execute_kw
  File "C:\Program Files (x86)\OpenERP 7.0-20141009-011214\server\.\openerp\osv\osv.py", line 132, in wrapper
  File "C:\Program Files (x86)\OpenERP 7.0-20141009-011214\server\.\openerp\osv\osv.py", line 199, in execute
  File "C:\Program Files (x86)\OpenERP 7.0-20141009-011214\server\.\openerp\osv\osv.py", line 187, in execute_cr
  File "C:\Program Files (x86)\OpenERP 7.0-20141009-011214\server\.\openerp\osv\orm.py", line 1610, in default_get
TypeError: _get_category() takes at least 6 arguments (4 given)
def _get_category(self, cr, uid, ids, field_name, arg, context=None): 
category_obj = self.pool.get('module.category').browse(cr, uid, category_id)
return {'value': {category_id': category_obj.name}}
_name ='module.level'
    _description ="Module Level"
    _columns = {
    'name':fields.char('Level', size=20),

Ajay Patel
On 12/18/15, 2:00 AM

functional field have 7 argument with self, and context, 

and use ids as a category_id

def _get_category(self, cr, uid, ids, field_name, arg, context=None): 
    category_obj = self.pool.get('module.category').browse(cr, uid, ids)
    return {'value': {'category_id': category_obj.name}}

@ajay No, same issue. i have edit my question with traceback

on 12/18/15, 2:05 AM

@supreeth you replace your function with this??

Ajay Patel
on 12/18/15, 2:11 AM

@ajay Yes

on 12/18/15, 2:12 AM

@supreeth give me traceback after replace function.

Ajay Patel
on 12/18/15, 2:21 AM

@ajay i posted

on 12/18/15, 2:26 AM

@supreeth its working for my side, check if you have problem to extend osv or import lib

Ajay Patel
on 12/18/15, 3:29 AM

@ajay Thank yo, it is working fine now. I had called that function in _default so it was throwing error. Working fine now

on 12/18/15, 3:57 AM

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: 12/18/15, 1:50 AM
Seen: 939 times
Last updated: 12/18/15, 4:06 AM