Check rule only if _check_access is set and enforce companies rule
issue4080 review343891009
This commit is contained in:
+1
-4
@@ -77,10 +77,7 @@ class Dunning(ModelSQL, ModelView):
|
||||
__name__ = 'account.dunning'
|
||||
company = fields.Many2One('company.company', 'Company', required=True,
|
||||
help="Make the dunning belong to the company.",
|
||||
select=True, domain=[
|
||||
('id', If(Eval('context', {}).contains('company'), '=', '!='),
|
||||
Eval('context', {}).get('company', -1)),
|
||||
],
|
||||
select=True,
|
||||
states=_STATES, depends=_DEPENDS)
|
||||
line = fields.Many2One('account.move.line', 'Line', required=True,
|
||||
help="The receivable line to dun for.",
|
||||
|
||||
+5
-5
@@ -225,16 +225,16 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<field name="group" ref="group_dunning"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.rule.group" id="rule_group_dunning">
|
||||
<field name="name">User in company</field>
|
||||
<record model="ir.rule.group" id="rule_group_dunning_companies">
|
||||
<field name="name">User in companies</field>
|
||||
<field name="model" search="[('model', '=', 'account.dunning')]"/>
|
||||
<field name="global_p" eval="True"/>
|
||||
</record>
|
||||
<record model="ir.rule" id="rule_dunning1">
|
||||
<record model="ir.rule" id="rule_dunning_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_dunning"/>
|
||||
<field name="rule_group" ref="rule_group_dunning_companies"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.model.access" id="access_dunning">
|
||||
|
||||
@@ -7,10 +7,10 @@ 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 CompanyMultiValueTestMixin
|
||||
from trytond.modules.company.tests import CompanyTestMixin
|
||||
|
||||
|
||||
class AccountDunningTestCase(CompanyMultiValueTestMixin, ModuleTestCase):
|
||||
class AccountDunningTestCase(CompanyTestMixin, ModuleTestCase):
|
||||
'Test AccountDunning module'
|
||||
module = 'account_dunning'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user