Initial Port of customer statements
This commit is contained in:
committed by
Miquel Raïch
parent
1ffec3d4ee
commit
ad482b33d0
36
partner_statement/tests/test_res_config_settings.py
Normal file
36
partner_statement/tests/test_res_config_settings.py
Normal file
@@ -0,0 +1,36 @@
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo.tests.common import TransactionCase
|
||||
|
||||
|
||||
class TestResConfigSettings(TransactionCase):
|
||||
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
self.config = self.env['res.config.settings']
|
||||
self.cr.execute(
|
||||
"SELECT uid FROM res_groups_users_rel "
|
||||
"WHERE gid IN (SELECT res_id FROM ir_model_data "
|
||||
" WHERE module='account' AND name='group_account_invoice') "
|
||||
"ORDER BY uid DESC LIMIT 1"
|
||||
)
|
||||
self.account_user = self.cr.fetchone()[0]
|
||||
self.user_obj = self.env['res.users'].sudo(self.account_user)
|
||||
|
||||
def test_groups(self):
|
||||
conf = self.config.create({
|
||||
"default_aging_type": "months",
|
||||
"group_activity_statement": True,
|
||||
"group_outstanding_statement": False,
|
||||
})
|
||||
conf.set_values()
|
||||
self.assertFalse(self.user_obj._has_group(
|
||||
'partner_statement.group_outstanding_statement')
|
||||
)
|
||||
self.assertTrue(self.user_obj._has_group(
|
||||
'partner_statement.group_activity_statement')
|
||||
)
|
||||
res = self.env['ir.default'].get(
|
||||
'activity.statement.wizard', 'aging_type'
|
||||
)
|
||||
self.assertEquals(res, 'months')
|
||||
Reference in New Issue
Block a user