Use 'irrulecontext' to add 'user_id' to context of ir.rule
This commit is contained in:
parent
f7fee173d7
commit
1bfa987746
1 changed files with 4 additions and 3 deletions
7
ir.py
7
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
|
||||
|
|
Loading…
Reference in a new issue