Fix ModelSingleton to return a list if limit is different of 1 and there is no

record.
This commit is contained in:
Cédric Krier committed 2009-09-09 23:42:33 +02:00
1 parent f4843866ed
commit bf937bcd30
1 file changed
+3 -1
+3 -1
View File
@@ -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,