Check rule only if _check_access is set and enforce companies rule

issue4080
This commit is contained in:
Raimon Esteve 2022-03-25 12:04:18 +01:00
parent d99e17d938
commit 98dc3e50ec
2 changed files with 4 additions and 3 deletions

View File

@ -30,7 +30,7 @@
</record>
<record model="ir.rule" id="rule_analytic_account_line1">
<field name="domain"
eval="[('company', '=', Eval('user', {}).get('company', None))]"
eval="[('internal_company', 'in', Eval('companies', []))]"
pyson="1"/>
<field name="rule_group" ref="rule_group_analytic_account_line"/>
</record>

View File

@ -11,11 +11,12 @@ from trytond.tests.test_tryton import ModuleTestCase, with_transaction
from trytond.transaction import Transaction
from trytond.pool import Pool
from trytond.modules.company.tests import create_company, set_company
from trytond.modules.company.tests import (CompanyTestMixin, create_company,
set_company)
from trytond.modules.account.tests import create_chart, get_fiscalyear
class TestCase(ModuleTestCase):
class TestCase(CompanyTestMixin, ModuleTestCase):
'''
Test module.
'''