Ravi Gohil (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-server/7.0-opw-584687-rgo into 
lp:openobject-server/7.0.

Requested reviews:
  Naresh(OpenERP) (nch-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-server/7.0-opw-584687-rgo/+merge/145803

hi,

The reason for this fix is that if an application passes a False value for 
'id', then the isinstance will evaluate to True, resulting in a Postgres query 
that compares integer to boolean, 
e.g. select * from account where account.id in (False)
and ended up throwing traceback.

Thanks.
-- 
https://code.launchpad.net/~openerp-dev/openobject-server/7.0-opw-584687-rgo/+merge/145803
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-server/7.0-opw-584687-rgo.
=== modified file 'openerp/osv/fields.py'
--- openerp/osv/fields.py	2013-01-11 17:57:17 +0000
+++ openerp/osv/fields.py	2013-01-31 10:33:04 +0000
@@ -462,7 +462,7 @@
         # we use uid=1 because the visibility of a many2one field value (just id and name)
         # must be the access right of the parent form and not the linked object itself.
         records = dict(obj.name_get(cr, SUPERUSER_ID,
-                                    list(set([x for x in res.values() if isinstance(x, (int,long))])),
+                                    list(set([x for x in res.values() if x and isinstance(x, (int,long))])),
                                     context=context))
         for id in res:
             if res[id] in records:

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : openerp-dev-gtk@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to