[IMP] osv/fields.py: improve code change of rev eea07e27

This commit is contained in:
Raphael Collet 2014-08-22 09:20:25 +02:00
parent 80d8532370
commit 48dfd70b4a
1 changed files with 2 additions and 6 deletions

View File

@ -1566,12 +1566,8 @@ class property(function):
column = obj._all_columns[prop_name].column
values = ir_property.get_multi(cr, uid, prop_name, obj._name, ids, context=context)
if column._type == 'many2one':
# name_get the values as SUPERUSER_ID
vals = None
for v in values.itervalues():
if v:
vals = v if not vals else (vals | v)
# name_get the non-null values as SUPERUSER_ID
vals = sum(set(filter(None, values.itervalues())))
vals_name = dict(vals.sudo().name_get()) if vals else {}
for id, value in values.iteritems():
ng = False