[FIX] orm: searching an inexisting id (as integer) return False (patch from Activity...
authorChristophe Simonis <christophe@tinyerp.com>
Fri, 5 Dec 2008 12:41:58 +0000 (13:41 +0100)
committerChristophe Simonis <christophe@tinyerp.com>
Fri, 5 Dec 2008 12:41:58 +0000 (13:41 +0100)
bzr revid: christophe@tinyerp.com-20081205124158-hjmig1c8gyp9qme3

bin/osv/orm.py

index 0803a7a..8a88372 100644 (file)
@@ -1801,7 +1801,7 @@ class orm(orm_template):
                 if v == None:
                     r[key] = False
         if isinstance(ids, (int, long)):
-            return result[0]
+            return result and result[0] or False
         return result
 
     def _read_flat(self, cr, user, ids, fields_to_read, context=None, load='_classic_read'):