details:   https://code.tryton.org/tryton/commit/d67c8bc15576
branch:    7.8
user:      Cédric Krier <[email protected]>
date:      Thu Jun 18 11:04:10 2026 +0200
description:
        Support ModelStorage.search API in ResourceAccessMixin

        ResourceAccessMixin inherits from ModelStorage so it should support the
        ModelStorage.search API.

        Closes #14900
        (grafted from 0011c5048a75906493f45a752958733d8cae5f12)
diffstat:

 trytond/trytond/ir/resource.py |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (30 lines):

diff -r 9e5684afd83d -r d67c8bc15576 trytond/trytond/ir/resource.py
--- a/trytond/trytond/ir/resource.py    Fri Jun 26 19:04:26 2026 +0200
+++ b/trytond/trytond/ir/resource.py    Thu Jun 18 11:04:10 2026 +0200
@@ -71,13 +71,14 @@
     @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
 
@@ -112,7 +113,7 @@
             loop += 1
             result = super().search(
                 domain, offset=offset + loop * limit, limit=limit, order=order,
-                count=False, query=False)
+                count=False)
             if not result:
                 break
 

Reply via email to