summaryrefslogtreecommitdiff
path: root/addons/account/tests/test_account_all_l10n.py
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
commit3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch)
treea44932296ef4a9b71d5f010906253d8c53727726 /addons/account/tests/test_account_all_l10n.py
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/account/tests/test_account_all_l10n.py')
-rw-r--r--addons/account/tests/test_account_all_l10n.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/addons/account/tests/test_account_all_l10n.py b/addons/account/tests/test_account_all_l10n.py
new file mode 100644
index 00000000..fbf9887b
--- /dev/null
+++ b/addons/account/tests/test_account_all_l10n.py
@@ -0,0 +1,35 @@
+# -*- coding: utf-8 -*-
+import logging
+
+from odoo.tests import standalone
+
+
+_logger = logging.getLogger(__name__)
+
+
+@standalone('all_l10n')
+def test_all_l10n(env):
+ """ This test will install all the l10n_* modules.
+ As the module install is not yet fully transactional, the modules will
+ remain installed after the test.
+ """
+ l10n_mods = env['ir.module.module'].search([
+ ('name', 'like', 'l10n%'),
+ ('state', '=', 'uninstalled'),
+ ])
+ l10n_mods.button_immediate_install()
+ env.reset() # clear the set of environments
+ env = env() # get an environment that refers to the new registry
+
+ coas = env['account.chart.template'].search([])
+ for coa in coas:
+ cname = 'company_%s' % str(coa.id)
+ company = env['res.company'].create({'name': cname})
+ env.user.company_ids += company
+ env.user.company_id = company
+ _logger.info('Testing COA: %s (company: %s)' % (coa.name, cname))
+ try:
+ with env.cr.savepoint():
+ coa.try_loading()
+ except Exception:
+ _logger.error("Error when creating COA %s", coa.name, exc_info=True)