[FIX] fields: in many2one property fields, name_get() the value as superuser
This commit is contained in:
parent
374fc8ec67
commit
618e397df1
|
@ -1566,8 +1566,11 @@ 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
|
||||||
|
vals = sum(values.itervalues())
|
||||||
|
vals_name = dict(vals.sudo().name_get())
|
||||||
for id, value in values.iteritems():
|
for id, value in values.iteritems():
|
||||||
res[id][prop_name] = value.name_get()[0] if value else False
|
res[id][prop_name] = vals_name.get(value.id, False)
|
||||||
else:
|
else:
|
||||||
for id, value in values.iteritems():
|
for id, value in values.iteritems():
|
||||||
res[id][prop_name] = value
|
res[id][prop_name] = value
|
||||||
|
|
Loading…
Reference in New Issue