[6.1] TypeError: unhashable type: 'list'

Bug #1138801 reported by Maxime Chambreuil (http://www.savoirfairelinux.com)
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenERP Management System
Invalid
Undecided
Virgil Dupras

Bug Description

On version 6.1, I created few actions and tried to group them in the tree view by user.

I got this message :

Client Traceback (most recent call last):
  File "/opt/home/openerp/sfl-openerp/openerp-web61/addons/web/common/http.py", line 180, in dispatch
    response["result"] = method(controller, self, **self.params)
  File "/opt/home/openerp/sfl-openerp/openerp-web61/addons/web/controllers/main.py", line 1082, in read
    dict(context, group_by=group_by_fields), sort or False)
  File "/opt/home/openerp/sfl-openerp/openerp-web61/addons/web/common/openerplib/main.py", line 250, in proxy
    args, kw)
  File "/opt/home/openerp/sfl-openerp/openerp-web61/addons/web/common/openerplib/main.py", line 117, in proxy
    result = self.connector.send(self.service_name, method, *args)
  File "/opt/home/openerp/sfl-openerp/openerp-web61/addons/web/common/http.py", line 608, in send
    raise xmlrpclib.Fault(openerp.tools.exception_to_unicode(e), formatted_info)

Server Traceback (most recent call last):
  File "/opt/home/openerp/sfl-openerp/openerp-web61/addons/web/common/http.py", line 593, in send
    return openerp.netsvc.dispatch_rpc(service_name, method, args)
  File "/opt/home/openerp/sfl-openerp/parts/openerp61/openerp/netsvc.py", line 360, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/opt/home/openerp/sfl-openerp/parts/openerp61/openerp/service/web_services.py", line 586, in dispatch
    res = fn(db, uid, *params)
  File "/opt/home/openerp/sfl-openerp/parts/openerp61/openerp/osv/osv.py", line 167, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/opt/home/openerp/sfl-openerp/parts/openerp61/openerp/osv/osv.py", line 121, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/opt/home/openerp/sfl-openerp/parts/openerp61/openerp/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/opt/home/openerp/sfl-openerp/openobjects-addons61/audittrail/audittrail.py", line 502, in execute_cr
    return self.log_fct(cr, uid, model, method, fct_src, *args)
  File "/opt/home/openerp/sfl-openerp/openobjects-addons61/audittrail/audittrail.py", line 294, in log_fct
    old_values = self.get_data(cr, uid_orig, pool, res_ids, model, method)
  File "/opt/home/openerp/sfl-openerp/openobjects-addons61/audittrail/audittrail.py", line 328, in get_data
    for resource in resource_pool.read(cr, 1, res_ids):
  File "/opt/home/openerp/sfl-openerp/parts/openerp61/openerp/osv/orm.py", line 3416, in read
    result = self._read_flat(cr, user, select, fields, context, load)
  File "/opt/home/openerp/sfl-openerp/parts/openerp61/openerp/osv/orm.py", line 3467, in _read_flat
    for sub_ids in cr.split_for_in_conditions(ids):
  File "/opt/home/openerp/sfl-openerp/parts/openerp61/openerp/sql_db.py", line 244, in split_for_in_conditions
    return tools.misc.split_every(self.IN_MAX, set(ids))
TypeError: unhashable type: 'list'

Tags: 6.1 action
Revision history for this message
Virgil Dupras (hsoft) wrote :

I can reproduce the error. I'm working on it.

Revision history for this message
Virgil Dupras (hsoft) wrote :

(By the way, the same error pops up when we try to group by type)

Revision history for this message
Virgil Dupras (hsoft) wrote :

At first, I thought the problem was simply that somewhere, state "in" selectors were wrapped in [] when they should be wrapped in (), which lead me to a wild goose chase. It seems that the problem is deeper than that: in audittrail.py:log_fct(), we only support 4 types of methods: create, read, unlink and write.

The method that is called is read_group and because of that, we end up in the final "else" condition, which expects "write" arguments. Therefore, arguments get all messed up.

I'll try to see what can be done about this, but it's probably a patch to submit to the "audittrail" module.

Revision history for this message
Virgil Dupras (hsoft) wrote :

The source of the problem is the same as the bug that has been opened at https://bugs.launchpad.net/openobject-addons/+bug/1013229

There's already a MP waiting for review and I've verified that the MP indeed fixes the problem.

Changed in openerp-mgmtsystem:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.