[IMP] fields: improve code in former commit

This commit is contained in:
Raphael Collet 2014-07-08 15:52:02 +02:00
parent b05cf32b8f
commit 603bde1b1b
1 changed files with 5 additions and 2 deletions

View File

@ -832,10 +832,13 @@ class Field(object):
computed = target.browse(env.computed[field])
if path == 'id':
target = records - computed
elif path:
target = (target.browse(env.cache[field]) - computed).filtered(
lambda rec: rec._mapped_cache(path) & records
)
else:
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))