From 85fbe1401170e9c2f977685b3968ffded70d41f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 4 Jul 2013 19:30:28 +0200 Subject: [PATCH] Fix Reference search on Function field review945002 --- trytond/model/modelsql.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/trytond/model/modelsql.py b/trytond/model/modelsql.py index 884526410d..b71333dbe3 100644 --- a/trytond/model/modelsql.py +++ b/trytond/model/modelsql.py @@ -1258,8 +1258,9 @@ class ModelSQL(ModelStorage): if 'active' in Target._fields: m2o_search += [('active', 'in', (True, False))] if hasattr(field, 'search'): + conv = int if field._type == 'many2one' else str domain.extend([(fargs[0], 'in', - map(int, Target.search(m2o_search, + map(conv, Target.search(m2o_search, order=[])))]) domain.pop(i) else: