Odoo Help


TypeError: unhashable type: 'dict' in wizard - how to debug?

on 5/21/13, 3:35 AM 4,896 views


I have defined a wizard, and cannot find a causo of an error. Please give me a direction. Wizard code:

from osv import osv, fields

class RemoteDbWizard(osv.TransientModel):
    _name = 'remotedb.wizard.fill'
    _columns = {
        'connection_id': fields.many2one(
        'remotedb.remote.connections', 'Connection'),

    def create(self, cr, uid, ids, context=None):
        return {'type': 'ir.actions.act_window_close'}

Wizard connects to this model:

class RemoteConnections(osv.Model):

_name = 'remotedb.remote.connections'
_description = 'Connection data'
_columns = {
    'name': fields.char('Name', size=40),
    'map_ids': fields.many2many('remotedb.table.mapping', 'connections_rel', 'connection_id', 'map_id', 'Connection mapping'),
    'database_id': fields.many2one('remotedb.remote.databases', 'Remote database'),

When pushing a button which is defined in wizard view (it calls create method), I am getting:

OpenERP WebClient Error

Client Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/openerp-7.0_20130514_231031-py2.7.egg/openerp/addons/web/http.py", line 204, in dispatch
    response["result"] = method(self, **self.params)
  File "/usr/local/lib/python2.7/dist-packages/openerp-7.0_20130514_231031-py2.7.egg/openerp/addons/web/controllers/main.py", line 1129, in call_kw
    return self._call_kw(req, model, method, args, kwargs)
  File "/usr/local/lib/python2.7/dist-packages/openerp-7.0_20130514_231031-py2.7.egg/openerp/addons/web/controllers/main.py", line 1113, in _call_kw
    names = dict(req.session.model(model).name_get(args[0], **kwargs))
TypeError: unhashable type: 'dict'

What could be wrong here? How could I debug this?

i think the problem is with your create method , in create method you don't have ids

on 5/21/13, 4:10 AM

Can you please elaborate on this? Is this not correct: "def create(self, cr, uid, ids, context=None):"? There is "ids" there...

on 5/21/13, 4:13 AM

ya but generally the parameter ids will not appear in create method i.e def create(self, cr, uid, vals, context=None):

on 5/21/13, 4:23 AM

Adjusted code according to your suggestion, but still getting the same error...

on 5/21/13, 4:33 AM

can you change the name of create function and call that function in your button

on 5/21/13, 4:51 AM

Renamed function, and no errors any more! Maniganda, thank you very much! Looks like one should be wary of which function names are better not to use!

on 5/21/13, 4:57 AM

ya , create is a standard function ,it has be used when ever there is a need or else we should use appropriate function names, if your error fixed then mark it as correct it will be helpfull for others

on 5/21/13, 5:00 AM

Maniganda, if you post your suggestions regarding my problem as an answer (not as a comment), I will be happy to mark your answer as "accepted".

on 5/21/13, 5:06 AM



| 6 8 7
Bangalore, India
On 5/21/13, 5:46 AM

Rename your function and call the function in your button, this will solve your issue

In addition to this answer: the cause of the error was a reserved method name, that is "create".

on 5/21/13, 5:52 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

0 follower(s)


Asked: 5/21/13, 3:35 AM
Seen: 4896 times
Last updated: 3/16/15, 8:10 AM