From 9cb4b15c45de18dc4c562189023931117bf29723 Mon Sep 17 00:00:00 2001 From: Frederik Jaeckel Date: Fri, 19 Jul 2024 15:33:50 +0200 Subject: [PATCH 1/3] update gitignore --- .hgignore => .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .hgignore => .gitignore (88%) diff --git a/.hgignore b/.gitignore similarity index 88% rename from .hgignore rename to .gitignore index bb7a7a5..f5d0da5 100644 --- a/.hgignore +++ b/.gitignore @@ -1,4 +1,4 @@ -syntax: glob +*.pyc build/* dist/* mds_cashbook.egg-info/* From 531c6b1537029476d6d02c1394ef8de565174fd1 Mon Sep 17 00:00:00 2001 From: Frederik Jaeckel Date: Fri, 19 Jul 2024 15:41:25 +0200 Subject: [PATCH 2/3] Use 'irrulecontext' to add 'user_id' to context of ir.rule --- ir.py | 25 +++++++------------------ tryton.cfg | 1 + versiondep.txt | 2 +- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/ir.py b/ir.py index 4054d93..0f81aec 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,22 +13,12 @@ class Rule(metaclass=PoolMeta): def _context_modelnames(cls): """ list of models to add 'user_id' to context """ - return [ - 'cashbook.book', 'cashbook.line', 'cashbook.recon', - 'cashbook.split'] - - @classmethod - def _get_context(cls, model_name): - context = super()._get_context(model_name) - if model_name in cls._context_modelnames(): - context['user_id'] = Transaction().user - return context - - @classmethod - def _get_cache_key(cls, model_name): - key = super()._get_cache_key(model_name) - if model_name in cls._context_modelnames(): - key = (*key, Transaction().user) - return key + result = super(Rule, cls)._context_modelnames() + return result | { + 'cashbook.book', + 'cashbook.line', + 'cashbook.recon', + 'cashbook.split' + } # end Rule diff --git a/tryton.cfg b/tryton.cfg index 97db8b7..f215bac 100644 --- a/tryton.cfg +++ b/tryton.cfg @@ -5,6 +5,7 @@ depends: currency party company + irrulecontext xml: icon.xml group.xml diff --git a/versiondep.txt b/versiondep.txt index 8b13789..d501ebb 100644 --- a/versiondep.txt +++ b/versiondep.txt @@ -1 +1 @@ - +irrulecontext;7.0.1;7.0.999;mds From 93af84690d025e52f7ce86cfd0a6c7bfb5b6ed91 Mon Sep 17 00:00:00 2001 From: Frederik Jaeckel Date: Fri, 19 Jul 2024 15:43:30 +0200 Subject: [PATCH 3/3] Version 7.0.36 --- README.rst | 4 ++++ tryton.cfg | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 684d05c..89efe3c 100644 --- a/README.rst +++ b/README.rst @@ -153,6 +153,10 @@ currency are converted into the display currency of the parent cash book. Changes ======= +*7.0.36 - 19.07.2024* + +- updt: optimize check of permissions + *7.0.35 - 01.06.2024* - add: config setting for fixate in booking-wizard diff --git a/tryton.cfg b/tryton.cfg index f215bac..4c72909 100644 --- a/tryton.cfg +++ b/tryton.cfg @@ -1,5 +1,5 @@ [tryton] -version=7.0.35 +version=7.0.36 depends: res currency