← Back to team overview

openerp-india team mailing list archive

[Bug 861875] Re: [6.0] TypeError: unhashable type: 'list'

 

You can try using this patch, it worked for me.

===================================================================
--- addons/openerp/controllers/form.py	(revision 15624)
+++ addons/openerp/controllers/form.py	(revision 15625)
@@ -668,9 +668,23 @@
             return base64.decodestring(res)
         
         elif params.id:
-            proxy = rpc.RPCProxy(params.model)
-            res = proxy.read([params.id],[params.field], rpc.session.context)
-            return base64.decodestring(res[0][params.field])
+            params_model = params.model
+            if isinstance(params_model, list):
+                params_model = params_model[0]
+                
+            proxy = rpc.RPCProxy(params_model)
+            rpc_session_context = rpc.session.context
+            
+            params_id = params.id
+            if isinstance(params_id, list):
+                params_id = params_id[0]
+            
+            res = proxy.read(params_id,[params.field], rpc_session_context)
+            if isinstance(res, list):
+                res_dict = res[0]
+            else:
+                res_dict = res
+            return base64.decodestring(res_dict[params.field])
         else:
             return base64.decodestring(data[params.field])

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Server.
https://bugs.launchpad.net/bugs/861875

Title:
  [6.0] TypeError: unhashable type: 'list'

Status in OpenERP Server:
  Invalid

Bug description:
  Using 6.0 branches, I tried to export the translation of a module.
  When I click on the button to download the po file, my web browser
  says:

  File not found
            Firefox can't find the file at http://localhost:8080/openerp/form/save_binary_data/en_US.po?_terp_field=data&_terp_filename=&_terp_model=base.language.export&_terp_id=4.

  and I have this message in the server console:

  [2011-09-28 17:57:45,388][MGMT] ERROR:web-services:Uncaught exception
  Traceback (most recent call last):
    File "/home/max/openerp/server/6.0/bin/osv/osv.py", line 122, in wrapper
      return f(self, dbname, *args, **kwargs)
    File "/home/max/openerp/server/6.0/bin/osv/osv.py", line 176, in execute
      res = self.execute_cr(cr, uid, obj, method, *args, **kw)
    File "/home/max/openerp/server/6.0/bin/osv/osv.py", line 164, in execute_cr
      object = pooler.get_pool(cr.dbname).get(obj)
    File "/home/max/openerp/server/6.0/bin/osv/osv.py", line 250, in get
      obj = self.obj_pool.get(name, None)
  TypeError: unhashable type: 'list'

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-server/+bug/861875/+subscriptions