From e1eb2bb48d5d3d0c8994b2468dd58dc1f65c3204 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 : 8.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 40672bc75f..95cecc8b11 100644 --- a/trytond/trytond/ir/resource.py +++ b/trytond/trytond/ir/resource.py @@ -70,13 +70,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