From 87f8c663bb8031612c5e1b5dd5538c4fcde00554 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 18 Jun 2026 11:04:10 +0200 Subject: [PATCH] Support ModelStorage.search API in ResourceAccessMixin ResourceAccessMixin inherits from ModelStorage so it should support the ModelStorage.search API. Closes #14900 (grafted from 0011c5048a75906493f45a752958733d8cae5f12) --HG-- branch : 7.0 --- trytond/trytond/ir/resource.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/trytond/trytond/ir/resource.py b/trytond/trytond/ir/resource.py index e88ce04aa2..329f50c815 100644 --- a/trytond/trytond/ir/resource.py +++ b/trytond/trytond/ir/resource.py @@ -69,13 +69,14 @@ class ResourceAccessMixin(ModelStorage): @classmethod def search( cls, domain, offset=0, limit=None, order=None, count=False, - query=False): + **kwargs): transaction = Transaction() enforce_access = ( - not query and transaction.user and transaction.check_access) + not kwargs.get('query', False) + and transaction.user and transaction.check_access) result = super().search( domain, offset=offset, limit=limit, order=order, - count=False if enforce_access else count, query=query) + count=False if enforce_access else count, **kwargs) if not enforce_access: return result @@ -110,7 +111,7 @@ class ResourceAccessMixin(ModelStorage): loop += 1 result = super().search( domain, offset=offset + loop * limit, limit=limit, order=order, - count=False, query=False) + count=False) if not result: break