changeset aa0ab91f0c1f in modules/production:default
details:
https://hg.tryton.org/modules/production?cmd=changeset&node=aa0ab91f0c1f
description:
Check rule only if _check_access is set and enforce companies rule
issue4080
review343891009
diffstat:
production.xml | 10 +++++-----
tests/test_production.py | 4 ++--
2 files changed, 7 insertions(+), 7 deletions(-)
diffs (41 lines):
diff -r 9b68fddbd19e -r aa0ab91f0c1f production.xml
--- a/production.xml Mon Apr 05 16:24:13 2021 +0200
+++ b/production.xml Sat Apr 10 23:46:23 2021 +0200
@@ -196,16 +196,16 @@
<field name="perm_delete" eval="True"/>
</record>
- <record model="ir.rule.group" id="rule_group_production">
- <field name="name">User in company</field>
+ <record model="ir.rule.group" id="rule_group_production_companies">
+ <field name="name">User in companies</field>
<field name="model" search="[('model', '=', 'production')]"/>
<field name="global_p" eval="True"/>
</record>
- <record model="ir.rule" id="rule_production">
+ <record model="ir.rule" id="rule_production_companies">
<field name="domain"
- eval="[('company', '=', Eval('user', {}).get('company',
None))]"
+ eval="[('company', 'in', Eval('companies', []))]"
pyson="1"/>
- <field name="rule_group" ref="rule_group_production"/>
+ <field name="rule_group" ref="rule_group_production_companies"/>
</record>
<record model="ir.model.button" id="production_cancel_button">
diff -r 9b68fddbd19e -r aa0ab91f0c1f tests/test_production.py
--- a/tests/test_production.py Mon Apr 05 16:24:13 2021 +0200
+++ b/tests/test_production.py Sat Apr 10 23:46:23 2021 +0200
@@ -10,10 +10,10 @@
from trytond.tests.test_tryton import doctest_checker
from trytond.pool import Pool
-from trytond.modules.company.tests import CompanyMultiValueTestMixin
+from trytond.modules.company.tests import CompanyTestMixin
-class ProductionTestCase(CompanyMultiValueTestMixin, ModuleTestCase):
+class ProductionTestCase(CompanyTestMixin, ModuleTestCase):
'Test Production module'
module = 'production'