From bf937bcd300b678781cd141c4a178f013cd3aeb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 9 Sep 2009 23:42:33 +0200 Subject: [PATCH] Fix ModelSingleton to return a list if limit is different of 1 and there is no record. --- trytond/model/modelsingleton.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/trytond/model/modelsingleton.py b/trytond/model/modelsingleton.py index efa153bddf..20029649db 100644 --- a/trytond/model/modelsingleton.py +++ b/trytond/model/modelsingleton.py @@ -77,7 +77,9 @@ class ModelSingleton(ModelStorage): res = super(ModelSingleton, self).search(cursor, user, domain, offset=0, limit=None, order=None, context=None, count=False) if not res: - return 1 + if limit == 1: + return 1 + return [1] return res def default_get(self, cursor, user, fields_names, context=None,