use irrulecontext to control context of ir.rule
This commit is contained in:
parent
77ffa9ab9d
commit
766e05a175
1 changed files with 9 additions and 4 deletions
13
ir.py
13
ir.py
|
@ -3,7 +3,6 @@
|
||||||
# The COPYRIGHT file at the top level of this repository contains the
|
# The COPYRIGHT file at the top level of this repository contains the
|
||||||
# full copyright notices and license terms.
|
# full copyright notices and license terms.
|
||||||
|
|
||||||
from trytond.transaction import Transaction
|
|
||||||
from trytond.pool import PoolMeta
|
from trytond.pool import PoolMeta
|
||||||
|
|
||||||
|
|
||||||
|
@ -12,10 +11,16 @@ class Rule(metaclass=PoolMeta):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _context_modelnames(cls):
|
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
|
# end Rule
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue