diff options
| author | Fabien Pinckaers <fp@tinyerp.com> | 2009-01-02 13:01:53 +0100 |
|---|---|---|
| committer | Fabien Pinckaers <fp@tinyerp.com> | 2009-01-02 13:01:53 +0100 |
| commit | 7daaba4be13e648b20560909fd0c0996e4e2e89c (patch) | |
| tree | 935a7e7a1ec773c646b366801bf4164e71220248 | |
| parent | 3dd49fc28356546c652f587e49b62a6598722f9d (diff) | |
bugfix
bzr revid: fp@tinyerp.com-20090102120153-kg2k9atqt5mbmxvi
| -rw-r--r-- | bin/osv/fields.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/bin/osv/fields.py b/bin/osv/fields.py index cf90bc4f162..83781964dc5 100644 --- a/bin/osv/fields.py +++ b/bin/osv/fields.py @@ -713,10 +713,17 @@ class related(function): else: t_data = t_data[self.arg[i]] if type(t_data) == type(objlst[0]): - # This should be improved, calling name_get - res[data.id] = (t_data.id,t_data.name) + res[data.id] = t_data.id else: res[data.id] = t_data + + if self._type=='many2one': + ids = filter(None, res.values()) + if ids: + ng = dict(obj.pool.get(self._obj).name_get(cr, uid, ids, context=context)) + for r in res: + if res[r]: + res[r] = (res[r], ng[res[r]]) return res def __init__(self, *arg, **args): |
