From 8b28a3cb5e88d8a859ac2fa74f5a60ddbe3fc359 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Sun, 19 Sep 2010 11:45:18 +0200 Subject: [PATCH] fix bzr revid: fp@tinyerp.com-20100919094518-j01cwcsarlgmtv0g --- bin/osv/fields.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/osv/fields.py b/bin/osv/fields.py index d35136ec9e6..0db8d9abf93 100644 --- a/bin/osv/fields.py +++ b/bin/osv/fields.py @@ -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