Compare commits
No commits in common. "93af84690d025e52f7ce86cfd0a6c7bfb5b6ed91" and "fef3138313f4d330119079b1406e15b8f6381e97" have entirely different histories.
93af84690d
...
fef3138313
5 changed files with 21 additions and 15 deletions
|
@ -1,4 +1,4 @@
|
|||
*.pyc
|
||||
syntax: glob
|
||||
build/*
|
||||
dist/*
|
||||
mds_cashbook.egg-info/*
|
|
@ -153,10 +153,6 @@ 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
|
||||
|
|
25
ir.py
25
ir.py
|
@ -3,6 +3,7 @@
|
|||
# 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
|
||||
|
||||
|
||||
|
@ -13,12 +14,22 @@ class Rule(metaclass=PoolMeta):
|
|||
def _context_modelnames(cls):
|
||||
""" list of models to add 'user_id' to context
|
||||
"""
|
||||
result = super(Rule, cls)._context_modelnames()
|
||||
return result | {
|
||||
'cashbook.book',
|
||||
'cashbook.line',
|
||||
'cashbook.recon',
|
||||
'cashbook.split'
|
||||
}
|
||||
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
|
||||
|
||||
# end Rule
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
[tryton]
|
||||
version=7.0.36
|
||||
version=7.0.35
|
||||
depends:
|
||||
res
|
||||
currency
|
||||
party
|
||||
company
|
||||
irrulecontext
|
||||
xml:
|
||||
icon.xml
|
||||
group.xml
|
||||
|
|
|
@ -1 +1 @@
|
|||
irrulecontext;7.0.1;7.0.999;mds
|
||||
|
||||
|
|
Loading…
Reference in a new issue