Check rule only if _check_access is set and enforce companies rule

issue4080
review343891009
This commit is contained in:
Cédric Krier committed 2021-04-10 23:46:24 +02:00
1 parent c30662f2bc
commit ba52762f10
2 files changed
+15 -1

No files matched your search

+12
View File
@@ -72,6 +72,18 @@ this repository contains the full copyright notices and license terms. -->
<field name="perm_delete" eval="True"/>
</record>
<record model="ir.rule.group" id="rule_group_quantity_early_plan_companies">
<field name="name">User in companies</field>
<field name="model" search="[('model', '=', 'stock.quantity.early_plan')]"/>
<field name="global_p" eval="True"/>
</record>
<record model="ir.rule" id="rule_quantity_early_plan_companies">
<field name="domain"
eval="[('company', 'in', Eval('companies', []))]"
pyson="1"/>
<field name="rule_group" ref="rule_group_quantity_early_plan_companies"/>
</record>
<record model="ir.model.button" id="quantity_early_plan_open_button">
<field name="name">open</field>
<field name="string">Reset to Open</field>
+3 -1
View File
@@ -10,8 +10,10 @@ from trytond.tests.test_tryton import suite as test_suite
from trytond.tests.test_tryton import doctest_teardown
from trytond.tests.test_tryton import doctest_checker
from trytond.modules.company.tests import CompanyTestMixin
class StockQuantityEarlyPlanningTestCase(ModuleTestCase):
class StockQuantityEarlyPlanningTestCase(CompanyTestMixin, ModuleTestCase):
'Test Stock Quantity Early Planning module'
module = 'stock_quantity_early_planning'
extras = ['production']