From 1bfa98774620c0b2593cbfbc2fd1a15cce3c9718 Mon Sep 17 00:00:00 2001 From: Frederik Jaeckel Date: Fri, 19 Jul 2024 16:02:19 +0200 Subject: [PATCH] Use 'irrulecontext' to add 'user_id' to context of ir.rule --- ir.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ir.py b/ir.py index 0e71a97..182092e 100644 --- a/ir.py +++ b/ir.py @@ -3,7 +3,6 @@ # The COPYRIGHT file at the top level of this repository contains the # full copyright notices and license terms. -from trytond.transaction import Transaction from trytond.pool import PoolMeta @@ -14,7 +13,9 @@ class Rule(metaclass=PoolMeta): def _context_modelnames(cls): """ list of models to add 'user_id' to context """ - return super(Rule, cls)._context_modelnames() + [ - 'cashbook.bookcategory'] + result = super(Rule, cls)._context_modelnames() + return result | { + 'cashbook.bookcategory', + } # end Rule