From 3e858f1da598a178711111bf5180384b23f2f0ad Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Fri, 13 Aug 2010 02:23:21 +0200 Subject: [PATCH] [FIX] orm/fields.function: function/related fields with type=m2o must properly return tuples (name_get) bzr revid: odo@openerp.com-20100813002321-13vb9675qvqr16kc --- bin/osv/fields.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/osv/fields.py b/bin/osv/fields.py index ec901b4ae34..44bda43fca2 100644 --- a/bin/osv/fields.py +++ b/bin/osv/fields.py @@ -657,7 +657,9 @@ class function(_column): self.selectable = False if store: - self._classic_read = True + if self._type != 'many2one': + # m2o fields need to return tuples with name_get, not just foreign keys + self._classic_read = True self._classic_write = True if type=='binary': self._symbol_get=lambda x:x and str(x)