From ee5ebbadabaedab09e05e3b0a0d03fb46fe5f919 Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Wed, 2 Aug 2017 10:19:15 +0200 Subject: [PATCH] [FIX] base/module: Use a correct env to load next action on install Bug introduced in https://github.com/odoo/odoo/commit/c8601f4384e0c95abc92d1f0b3092cfe2cb2a79d Purpose ======= If a module installation is supposed to load an action (example: a wizard like in l10n_eu_service) and if the related action is defined in this module (example: l10n_eu_service.wizard), currently we're using the environment defined on self, which is not updated after the module install, and the key is not defined in the registry. Specification ============= Instead of using the environment on self, let's use the new environment created after the cursor commit. --- odoo/addons/base/module/module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/addons/base/module/module.py b/odoo/addons/base/module/module.py index b433a1b07f7..32c875c3fd8 100644 --- a/odoo/addons/base/module/module.py +++ b/odoo/addons/base/module/module.py @@ -506,7 +506,7 @@ class Module(models.Model): self._cr.commit() env = api.Environment(self._cr, self._uid, self._context) - config = self.next() or {} + config = env['ir.module.module'].next() or {} if config.get('type') not in ('ir.actions.act_window_close',): return config