changeset 1d1004124b59 in modules/stock_quantity_issue:default
details:
https://hg.tryton.org/modules/stock_quantity_issue?cmd=changeset&node=1d1004124b59
description:
Check rule only if _check_access is set and enforce companies rule
issue4080
review343891009
diffstat:
stock.xml | 12 ++++++++++++
tests/test_stock_quantity_issue.py | 4 +++-
2 files changed, 15 insertions(+), 1 deletions(-)
diffs (37 lines):
diff -r 4b5f2cef56b9 -r 1d1004124b59 stock.xml
--- a/stock.xml Mon Apr 05 16:24:13 2021 +0200
+++ b/stock.xml Sat Apr 10 23:46:24 2021 +0200
@@ -72,6 +72,18 @@
<field name="perm_delete" eval="True"/>
</record>
+ <record model="ir.rule.group" id="rule_group_quantity_issue_companies">
+ <field name="name">User in companies</field>
+ <field name="model" search="[('model', '=',
'stock.quantity.issue')]"/>
+ <field name="global_p" eval="True"/>
+ </record>
+ <record model="ir.rule" id="rule_quantity_issue_companies">
+ <field name="domain"
+ eval="[('company', 'in', Eval('companies', []))]"
+ pyson="1"/>
+ <field name="rule_group"
ref="rule_group_quantity_issue_companies"/>
+ </record>
+
<record model="ir.model.button" id="quantity_issue_open_button">
<field name="name">open</field>
<field name="string">Reset to Open</field>
diff -r 4b5f2cef56b9 -r 1d1004124b59 tests/test_stock_quantity_issue.py
--- a/tests/test_stock_quantity_issue.py Mon Apr 05 16:24:13 2021 +0200
+++ b/tests/test_stock_quantity_issue.py Sat Apr 10 23:46:24 2021 +0200
@@ -10,8 +10,10 @@
from trytond.tests.test_tryton import doctest_teardown
from trytond.tests.test_tryton import doctest_checker
+from trytond.modules.company.tests import CompanyTestMixin
-class StockQuantityIssueTestCase(ModuleTestCase):
+
+class StockQuantityIssueTestCase(CompanyTestMixin, ModuleTestCase):
'Test Stock Quantity Issue module'
module = 'stock_quantity_issue'
extras = ['production']