Fix ModelSingleton to return a list if limit is different of 1 and there is no
record.
This commit is contained in:
1 parent
f4843866ed
commit
bf937bcd30
1 file changed
+3
-1
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user