[IMP] fields.related._fnct_read: small improvements

bzr revid: rco@openerp.com-20121105131712-sc70thn3wpyq6o7y
This commit is contained in:
Raphael Collet 2012-11-05 14:17:12 +01:00
parent 52c29ae1c0
commit 750ef9d931
1 changed files with 1 additions and 1 deletions

View File

@ -1189,7 +1189,7 @@ class related(function):
# res[id] is a browse_record or False; convert it to (id, name) or False.
# Perform name_get as root, as seeing the name of a related object depends on
# access right of source document, not target, so user may not have access.
value_ids = [value.id for id, value in res.iteritems() if value]
value_ids = list(set(value.id for value in res.itervalues() if value))
value_name = dict(obj.pool.get(self._obj).name_get(cr, SUPERUSER_ID, value_ids, context=context))
res = dict((id, value and (value.id, value_name[value.id])) for id, value in res.iteritems())