changeset 530e423392cb in modules/sale_complaint:default
details:
https://hg.tryton.org/modules/sale_complaint?cmd=changeset&node=530e423392cb
description:
Check rule only if _check_access is set and enforce companies rule
issue4080
review343891009
diffstat:
complaint.xml | 10 +++++-----
tests/test_sale_complaint.py | 4 ++--
2 files changed, 7 insertions(+), 7 deletions(-)
diffs (41 lines):
diff -r 78038eb7c59b -r 530e423392cb complaint.xml
--- a/complaint.xml Fri Apr 09 10:52:03 2021 +0200
+++ b/complaint.xml Sat Apr 10 23:46:24 2021 +0200
@@ -177,16 +177,16 @@
<field name="action" ref="act_complaint_relate_sale"/>
</record>
- <record model="ir.rule.group" id="rule_group_complaint">
- <field name="name">User in company</field>
+ <record model="ir.rule.group" id="rule_group_complaint_companies">
+ <field name="name">User in companies</field>
<field name="model" search="[('model', '=', 'sale.complaint')]"/>
<field name="global_p" eval="True"/>
</record>
- <record model="ir.rule" id="rule_complaint1">
+ <record model="ir.rule" id="rule_complaint_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_complaint"/>
+ <field name="rule_group" ref="rule_group_complaint_companies"/>
</record>
<record model="ir.model.access" id="access_complaint">
diff -r 78038eb7c59b -r 530e423392cb tests/test_sale_complaint.py
--- a/tests/test_sale_complaint.py Fri Apr 09 10:52:03 2021 +0200
+++ b/tests/test_sale_complaint.py Sat Apr 10 23:46:24 2021 +0200
@@ -7,10 +7,10 @@
from trytond.tests.test_tryton import doctest_teardown
from trytond.tests.test_tryton import doctest_checker
-from trytond.modules.company.tests import CompanyMultiValueTestMixin
+from trytond.modules.company.tests import CompanyTestMixin
-class SaleComplaintTestCase(CompanyMultiValueTestMixin, ModuleTestCase):
+class SaleComplaintTestCase(CompanyTestMixin, ModuleTestCase):
'Test Sale Complaint module'
module = 'sale_complaint'