diff --git a/__init__.py b/__init__.py index e8af3da..e5bafe6 100644 --- a/__init__.py +++ b/__init__.py @@ -6,6 +6,7 @@ from trytond.pool import Pool from .category import Category from .book import CategoryCashbookRel, Cashbook +from .ir import Rule def register(): @@ -13,4 +14,5 @@ def register(): Category, Cashbook, CategoryCashbookRel, + Rule, module='cashbook_bookcategory', type_='model') diff --git a/category.xml b/category.xml index eab3ea6..41b5fbb 100644 --- a/category.xml +++ b/category.xml @@ -115,7 +115,7 @@ diff --git a/ir.py b/ir.py new file mode 100644 index 0000000..0e71a97 --- /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() + [ + 'cashbook.bookcategory'] + +# end Rule