[IMP] fields: add missing case for invalidating fields, when path is None
authorRaphael Collet <rco@openerp.com>
Tue, 8 Jul 2014 13:47:44 +0000 (15:47 +0200)
committerRaphael Collet <rco@openerp.com>
Tue, 8 Jul 2014 13:47:44 +0000 (15:47 +0200)
openerp/fields.py

index f8b5bd4..d4a880c 100644 (file)
@@ -833,9 +833,9 @@ class Field(object):
             if path == 'id':
                 target = records - computed
             else:
-                for record in target.browse(env.cache[field]) - computed:
-                    if record._mapped_cache(path) & records:
-                        target += record
+                target = target.browse(env.cache[field]) - computed
+                if path:
+                    target = target.filtered(lambda rec: rec._mapped_cache(path) & records)
             if target:
                 spec.append((field, target._ids))