Check rule only if _check_access is set and enforce companies rule

issue4080
This commit is contained in:
Raimon Esteve 2022-03-22 18:50:37 +01:00
parent a13f67c8e7
commit 6b9fbb3b78
2 changed files with 3 additions and 2 deletions

View file

@ -89,7 +89,7 @@ this repository contains the full copyright notices and license terms. -->
</record>
<record model="ir.rule" id="rule_commission_manager1">
<field name="domain"
eval="[('company', '=', Eval('user', {}).get('company', None))]"
eval="[('company', 'in', Eval('companies', []))]"
pyson="1"/>
<field name="rule_group" ref="rule_group_commission_manager"/>
</record>

View file

@ -7,9 +7,10 @@ from trytond.tests.test_tryton import ModuleTestCase
from trytond.tests.test_tryton import suite as test_suite
from trytond.tests.test_tryton import doctest_setup, doctest_teardown
from trytond.tests.test_tryton import doctest_checker
from trytond.modules.company.tests import CompanyTestMixin
class CommissionManagerTestCase(ModuleTestCase):
class CommissionManagerTestCase(CompanyTestMixin, ModuleTestCase):
'Test Commission Manager module'
module = 'commission_manager'