diff --git a/__init__.py b/__init__.py index 38bf5dd..072af28 100644 --- a/__init__.py +++ b/__init__.py @@ -10,6 +10,7 @@ from .currency import Currency from .evaluation_context import EvaluationContext from .evaluation_wizard import OpenChartWizard from .investment import InvestmentEvaluation, InvestmentLine +from .ir import Rule def register(): @@ -18,6 +19,7 @@ def register(): Evaluation, EvaluationLine, EvaluationContext, + Rule, module='cashbook_report', type_='model') Pool.register( OpenChartWizard, diff --git a/evaluation.xml b/evaluation.xml index 848f7c6..a1dea71 100644 --- a/evaluation.xml +++ b/evaluation.xml @@ -96,7 +96,7 @@ full copyright notices and license terms. --> diff --git a/ir.py b/ir.py new file mode 100644 index 0000000..a8057c8 --- /dev/null +++ b/ir.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# This file is part of the cashbook-module from m-ds.de for Tryton. +# 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 + + +class Rule(metaclass=PoolMeta): + __name__ = 'ir.rule' + + @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'] + +# end Rule diff --git a/ir.xml b/ir.xml index 96b603a..ad9fb06 100644 --- a/ir.xml +++ b/ir.xml @@ -20,7 +20,7 @@ full copyright notices and license terms. -->