From fa2f85adbe033951045d119ce5a9e9517c36b22d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 12 Apr 2023 18:35:52 +0200 Subject: [PATCH] Set limit attribute only if defined in URL Closes #12211 --- sao/src/sao.js | 4 +++- tryton/tryton/gui/main.py | 9 ++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/sao/src/sao.js b/sao/src/sao.js index 6afb1f4e62..896cab6e11 100644 --- a/sao/src/sao.js +++ b/sao/src/sao.js @@ -516,7 +516,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 || '[]'); diff --git a/tryton/tryton/gui/main.py b/tryton/tryton/gui/main.py index a6fb590d98..09942d1d4a 100644 --- a/tryton/tryton/gui/main.py +++ b/tryton/tryton/gui/main.py @@ -978,6 +978,7 @@ class Main(Gtk.Application): return def open_model(path): + attributes = {} model, path = (path.split('/', 1) + [''])[:2] if not model: return @@ -985,7 +986,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) @@ -1013,9 +1016,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