From 77ffa9ab9d74d839fb788300bd4bde2cf5f72403 Mon Sep 17 00:00:00 2001 From: Frederik Jaeckel Date: Fri, 19 Jul 2024 17:11:07 +0200 Subject: [PATCH 1/2] update gitignore --- .hgignore => .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .hgignore => .gitignore (86%) diff --git a/.hgignore b/.gitignore similarity index 86% rename from .hgignore rename to .gitignore index c840977..7ff2f3a 100644 --- a/.hgignore +++ b/.gitignore @@ -1,4 +1,4 @@ -syntax: glob +*.pyc build/* dist/* mds_cashbook_report.egg-info/* From 766e05a175ff8a49314bfa53f32dd3d7336b9b15 Mon Sep 17 00:00:00 2001 From: Frederik Jaeckel Date: Fri, 19 Jul 2024 17:11:39 +0200 Subject: [PATCH 2/2] use irrulecontext to control context of ir.rule --- ir.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ir.py b/ir.py index 1573ebf..0a74a0a 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 @@ -12,10 +11,16 @@ class Rule(metaclass=PoolMeta): @classmethod def _context_modelnames(cls): - """ list of models to add 'user_id' to context """ - return super(Rule, cls)._context_modelnames() + [ - 'ir.action.act_window', 'cashbook_report.evaluation'] + + Returns: + set: model-names + """ + result = super(Rule, cls)._context_modelnames() + return result | { + 'ir.action.act_window', + 'cashbook_report.evaluation', + } # end Rule