Repository: odoo/odoo

Issue #10055: Errors while saving sale order/quotation lines with taxes assigned
Created: 2015-12-13T23:14:44Z
There seems to be a problem with a change made in commit 7e2628a - tested on fresh install with only sales module installed. While trying to save quotation/sale order with lines that have modified taxes field (or new lines with automatically assigned taxes), there are multiple odoo server errors - TypeError: unhashable type: 'list'. The issue probably exists everywhere where m2m tags fields are used in list views. Rolling back to previous commit fixes the issue.
Steps to reproduce:

fresh install with sale module only
create test product
create new quotation with that product with some taxes assigned (create new one or use some existing accounting module, tested with i10n_pl)
while trying to save there are multiple error popups, but the changes seems to be saved

All errors looks the same:
Traceback (most recent call last):
  File "/path/to/odoo/openerp/http.py", line 605, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/path/to/odoo/openerp/http.py", line 642, in dispatch
    result = self._call_function(**self.params)
  File "/path/to/odoo/openerp/http.py", line 316, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/path/to/odoo/openerp/service/model.py", line 118, in wrapper
    return f(dbname, *args, **kwargs)
  File "/path/to/odoo/openerp/http.py", line 309, in checked_call
    result = self.endpoint(*a, **kw)
  File "/path/to/odoo/openerp/http.py", line 893, in __call__
    return self.method(*args, **kw)
  File "/path/to/odoo/openerp/http.py", line 471, in response_wrap
    response = f(*args, **kw)
  File "/path/to/odoo/addons/web/controllers/main.py", line 994, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/path/to/odoo/addons/web/controllers/main.py", line 986, in _call_kw
    return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
  File "/path/to/odoo/openerp/api.py", line 238, in wrapper
    return old_api(self, *args, **kwargs)
  File "/path/to/odoo/openerp/api.py", line 369, in old_api
    result = method(recs, *args, **kwargs)
  File "/path/to/odoo/openerp/models.py", line 5985, in onchange
    record = self.new(values)
  File "/path/to/odoo/openerp/api.py", line 236, in wrapper
    return new_api(self, *args, **kwargs)
  File "/path/to/odoo/openerp/models.py", line 5555, in new
    record._cache.update(record._convert_to_cache(values, update=True))
  File "/path/to/odoo/openerp/models.py", line 5450, in _convert_to_cache
    for name, value in values.iteritems()
  File "/path/to/odoo/openerp/models.py", line 5451, in <dictcomp>
    if name in fields
  File "/path/to/odoo/openerp/fields.py", line 1743, in convert_to_cache
    ids = OrderedSet(command[2])
  File "/path/to/odoo/openerp/tools/misc.py", line 1106, in __init__
    super(OrderedSet, self).__init__([(x, None) for x in seq])
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/collections.py", line 52, in __init__
    self.__update(*args, **kwds)
  File "/path/to/python/virtual/env/bin/../lib/python2.7/_abcoll.py", line 567, in update
    self[key] = value
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/collections.py", line 58, in __setitem__
    if key not in self:
TypeError: unhashable type: 'list'

Tested on OSX 10.10.5 with Safari 9.0.1 and Firefox 42.0

Duplicate issue #10069: Getting error after specifying tax in invoice line v9.
Created: 2015-12-14T21:15:10Z
Create a new invoice with invoice line having a tax. Saving the record will show error.
File "/home/omalbastin/WORK/odoo/openerp/http.py", line 605, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/home/omalbastin/WORK/odoo/openerp/http.py", line 642, in dispatch
result = self._call_function(*_self.params)
File "/home/omalbastin/WORK/odoo/openerp/http.py", line 316, in _call_function
return checked_call(self.db, *args, *_kwargs)
File "/home/omalbastin/WORK/odoo/openerp/service/model.py", line 118, in wrapper
return f(dbname, _args, *_kwargs)
File "/home/omalbastin/WORK/odoo/openerp/http.py", line 309, in checked_call
result = self.endpoint(_a, *_kw)
File "/home/omalbastin/WORK/odoo/openerp/http.py", line 893, in call
return self.method(_args, *_kw)
File "/home/omalbastin/WORK/odoo/openerp/http.py", line 471, in response_wrap
response = f(_args, *_kw)
File "/home/omalbastin/WORK/odoo/addons/web/controllers/main.py", line 892, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/home/omalbastin/WORK/odoo/addons/web/controllers/main.py", line 884, in _call_kw
return getattr(request.registry.get(model), method)(request.cr, request.uid, _args, *_kwargs)
File "/home/omalbastin/WORK/odoo/openerp/api.py", line 238, in wrapper
return old_api(self, _args, *_kwargs)
File "/home/omalbastin/WORK/odoo/openerp/api.py", line 369, in old_api
result = method(recs, _args, *_kwargs)
File "/home/omalbastin/WORK/odoo/openerp/models.py", line 5987, in onchange
record = self.new(values)
File "/home/omalbastin/WORK/odoo/openerp/api.py", line 236, in wrapper
return new_api(self, _args, *_kwargs)
File "/home/omalbastin/WORK/odoo/openerp/models.py", line 5557, in new
record._cache.update(record._convert_to_cache(values, update=True))
File "/home/omalbastin/WORK/odoo/openerp/models.py", line 5452, in _convert_to_cache
for name, value in values.iteritems()
File "/home/omalbastin/WORK/odoo/openerp/models.py", line 5453, in 
if name in fields
File "/home/omalbastin/WORK/odoo/openerp/fields.py", line 1744, in convert_to_cache
ids = OrderedSet(command[2])
File "/home/omalbastin/WORK/odoo/openerp/tools/misc.py", line 1106, in init
super(OrderedSet, self).init([(x, None) for x in seq])
File "/usr/lib/python2.7/collections.py", line 57, in init
self.*update(_args, _kwds)
File "/usr/lib/python2.7/_abcoll.py", line 569, in update
self[key] = value
File "/usr/lib/python2.7/collections.py", line 63, in __setitem
if key not in self:
TypeError: unhashable type: 'list'

Closing comment (2015-12-15T16:37:44Z): Hi, I suggest we close this issue as a duplicate of #10055, which contains more information, and confirm the latter, if you don't mind.