Set limit attribute only if defined in URL

Closes #12211
(grafted from c242bc152fb39bafb90581710aefbe8260d54178)

--HG--
branch : 6.0
This commit is contained in:
Cédric Krier committed 2023-04-12 18:35:52 +02:00
1 parent cb4f847845
commit 1076ad75fe
2 files changed
+9 -4

No files matched your search

+3 -1
View File
@@ -476,7 +476,9 @@ var Sao = {};
}
try {
attributes.view_ids = loads(params.views || '[]');
attributes.limit = loads(params.limi || 'null');
if (params.limit !== undefined) {
attributes.limit = loads(params.limit || 'null');
}
attributes.name = loads(params.name || '""');
attributes.search_value = loads(params.search_value || '[]');
attributes.domain = loads(params.domain || '[]');
+6 -3
View File
@@ -963,6 +963,7 @@ class Main(Gtk.Application):
return
def open_model(path):
attributes = {}
model, path = (path.split('/', 1) + [''])[:2]
if not model:
return
@@ -970,7 +971,9 @@ class Main(Gtk.Application):
mode = None
try:
view_ids = json.loads(params.get('views', '[]'))
limit = json.loads(params.get('limit', 'null'))
if 'limit' in params:
attributes['limit'] = json.loads(
params.get('limit', 'null'))
name = json.loads(params.get('name', '""'))
search_value = json.loads(params.get('search_value', '[]'),
object_hook=object_hook)
@@ -998,9 +1001,9 @@ class Main(Gtk.Application):
context_model=context_model,
mode=mode,
name=name,
limit=limit,
search_value=search_value,
tab_domain=tab_domain)
tab_domain=tab_domain,
**attributes)
except Exception:
# Prevent crashing the client
return