+4
-3
@@ -314,11 +314,12 @@ class many2one(_column):
|
||||
obj = obj.pool.get(self._obj)
|
||||
|
||||
# build a dictionary of the form {'id_of_distant_resource': name_of_distant_resource}
|
||||
# uid=1 because visibility of a many2one= visibility of parent object
|
||||
# we use uid=1 because the visibility of a many2one field value (just id and name)
|
||||
# must be the access right of the parent form and not the linked object itself.
|
||||
records = dict(obj.name_get(cr, 1, list(set(filter(None, res.values()))), context=context))
|
||||
for id in res:
|
||||
if id in records:
|
||||
res[id] = (id, records[id])
|
||||
if res[id] in records:
|
||||
res[id] = (res[id], records[res[id]])
|
||||
else:
|
||||
res[id] = False
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user