[FIX] two loops one loop (a previous commit) was wrongly done :(.
authorVo Minh Thu <vmt@openerp.com>
Wed, 5 Oct 2011 13:55:49 +0000 (15:55 +0200)
committerVo Minh Thu <vmt@openerp.com>
Wed, 5 Oct 2011 13:55:49 +0000 (15:55 +0200)
bzr revid: vmt@openerp.com-20111005135549-xvhtt57fl1ib7o6e

openerp/osv/fields.py

index aae6e4a..6cc5255 100644 (file)
@@ -165,11 +165,10 @@ class reference(_column):
         result = {}
         # copy initial values fetched previously.
         for value in values:
+            result[value['id']] = value[name]
             if value[name]:
                 model, res_id = value[name].split(',')
-                if obj.pool.get(model).exists(cr, uid, [int(res_id)], context=context):
-                    result[value['id']] = value[name]
-                else:
+                if not obj.pool.get(model).exists(cr, uid, [int(res_id)], context=context):
                     result[value['id']] = False
         return result