Check rule only if _check_access is set and enforce companies rule

issue4080
This commit is contained in:
Raimon Esteve 2022-03-22 17:56:05 +01:00
parent 11098f7dc0
commit e691718e0a
2 changed files with 6 additions and 5 deletions

View File

@ -155,7 +155,7 @@ contains the full copyright notices and license terms. -->
</record>
<record model="ir.rule" id="rule_aeat_347_1">
<field name="domain"
eval="[('company', '=', Eval('user', {}).get('company', None))]"
eval="[('company', 'in', Eval('companies', []))]"
pyson="1"/>
<field name="rule_group" ref="rule_group_aeat347"/>
</record>
@ -167,7 +167,7 @@ contains the full copyright notices and license terms. -->
</record>
<record model="ir.rule" id="rule_aeat_347_party_1">
<field name="domain"
eval="[('company', '=', Eval('user', {}).get('company', None))]"
eval="[('company', 'in', Eval('companies', []))]"
pyson="1"/>
<field name="rule_group" ref="rule_group_aeat347_party"/>
</record>
@ -181,7 +181,7 @@ contains the full copyright notices and license terms. -->
</record>
<record model="ir.rule" id="rule_aeat_347_property_1">
<field name="domain"
eval="[('company', '=', Eval('user', {}).get('company', None))]"
eval="[('company', 'in', Eval('companies', []))]"
pyson="1"/>
<field name="rule_group" ref="rule_group_aeat347_property"/>
</record>
@ -192,7 +192,7 @@ contains the full copyright notices and license terms. -->
</record>
<record model="ir.rule" id="rule_aeat_347_record_1">
<field name="domain"
eval="[('company', '=', Eval('user', {}).get('company', None))]"
eval="[('company', 'in', Eval('companies', []))]"
pyson="1"/>
<field name="rule_group" ref="rule_group_aeat347_record"/>
</record>

View File

@ -7,9 +7,10 @@ import trytond.tests.test_tryton
from trytond.tests.test_tryton import ModuleTestCase
from trytond.tests.test_tryton import doctest_teardown
from trytond.tests.test_tryton import doctest_checker
from trytond.modules.company.tests import CompanyTestMixin
class Aeat347TestCase(ModuleTestCase):
class Aeat347TestCase(CompanyTestMixin, ModuleTestCase):
'Test Aeat 347 module'
module = 'aeat_347'