summaryrefslogtreecommitdiff
path: root/odoo/addons/base/models/ir_module.py
diff options
context:
space:
mode:
authorChristophe Monniez <moc@odoo.com>2019-05-24 15:01:18 +0000
committerChristophe Monniez <moc@odoo.com>2019-05-27 09:17:21 +0000
commitad2feb07f0bc2114f85e0ced24392da348b80c29 (patch)
tree87e01fff1682e6f0001fe57d5151553bbb5bd23a /odoo/addons/base/models/ir_module.py
parent27c0da9cb9d511dfb4ef852feef760b28f17c726 (diff)
[FIX] base, account: allow AllL10n test case to start
Since a5b6f31, an attribute allowed_company_ids is set on request when calling the module button_immediate_install method. This method is called during the test TestAllL10n which does not have a bound request and makes it fail. With this commit, the attribute is set only if request is bound. By the way, a small improvement is added in the test. Before this commit, when the test was failing because of the button_immediate_install, it was immediately stopped. The same problem was arising during the test method, it was stopped at the first failure. As this test is run as a nightly test, one have to wait the next day to discover the next problem. With this commit, the exceptions are catched during the l10n_ modules installation and a simple error line is written in the logs. That way, the runbot will still detect the error. Also, the main test method that installs all the chart of accounts splits those install into subtests. This prevent the method to stop at first failure. closes odoo/odoo#33654 Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Diffstat (limited to 'odoo/addons/base/models/ir_module.py')
-rw-r--r--odoo/addons/base/models/ir_module.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/odoo/addons/base/models/ir_module.py b/odoo/addons/base/models/ir_module.py
index 1afe44bb05c..cd48963b253 100644
--- a/odoo/addons/base/models/ir_module.py
+++ b/odoo/addons/base/models/ir_module.py
@@ -445,7 +445,8 @@ class Module(models.Model):
# allowed companies to configure it on the correct company.
# Otherwise, the SUPERUSER won't be aware of that and will try to
# configure the CoA on his own company, which makes no sense.
- request.allowed_company_ids = self.env.company_ids.ids
+ if request:
+ request.allowed_company_ids = self.env.company_ids.ids
return self._button_immediate_function(type(self).button_install)
@assert_log_admin_access