[IMP] osv/fields.py: improve code change of rev eea07e27
This commit is contained in:
parent
80d8532370
commit
48dfd70b4a
|
@ -1566,12 +1566,8 @@ class property(function):
|
||||||
column = obj._all_columns[prop_name].column
|
column = obj._all_columns[prop_name].column
|
||||||
values = ir_property.get_multi(cr, uid, prop_name, obj._name, ids, context=context)
|
values = ir_property.get_multi(cr, uid, prop_name, obj._name, ids, context=context)
|
||||||
if column._type == 'many2one':
|
if column._type == 'many2one':
|
||||||
# name_get the values as SUPERUSER_ID
|
# name_get the non-null values as SUPERUSER_ID
|
||||||
vals = None
|
vals = sum(set(filter(None, values.itervalues())))
|
||||||
for v in values.itervalues():
|
|
||||||
if v:
|
|
||||||
vals = v if not vals else (vals | v)
|
|
||||||
|
|
||||||
vals_name = dict(vals.sudo().name_get()) if vals else {}
|
vals_name = dict(vals.sudo().name_get()) if vals else {}
|
||||||
for id, value in values.iteritems():
|
for id, value in values.iteritems():
|
||||||
ng = False
|
ng = False
|
||||||
|
|
Loading…
Reference in New Issue