bzr revid: fp@tinyerp.com-20100919094518-j01cwcsarlgmtv0g
This commit is contained in:
Fabien Pinckaers
2010-09-19 11:45:18 +02:00
parent a8aa3bba98
commit 8b28a3cb5e
+4 -3
View File
@@ -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