summaryrefslogtreecommitdiff
path: root/odoo/addons/base/module
diff options
context:
space:
mode:
authorYannick Tivisse <yti@odoo.com>2017-06-16 12:03:59 +0200
committerYannick Tivisse <yti@odoo.com>2017-06-19 17:37:38 +0200
commit56feb8dd164ee39eceeb37c61cded1ff4afaafdf (patch)
treeade0b5f312a4961ba3a054cc5ca42fbb68559cde /odoo/addons/base/module
parent1196409a9fcb1d50ec8c198d8257444957802f55 (diff)
[IMP] base: Load actions todo on button_immediate_install
Diffstat (limited to 'odoo/addons/base/module')
-rw-r--r--odoo/addons/base/module/module.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/odoo/addons/base/module/module.py b/odoo/addons/base/module/module.py
index fd5ba44c9d1..bfc018f247f 100644
--- a/odoo/addons/base/module/module.py
+++ b/odoo/addons/base/module/module.py
@@ -479,6 +479,23 @@ class Module(models.Model):
known_deps |= missing_mods.upstream_dependencies(known_deps, exclude_states)
return known_deps
+ def next(self):
+ """
+ Return the action linked to an ir.actions.todo is there exists one that
+ should be executed. Otherwise, redirect to /web
+ """
+ Todos = self.env['ir.actions.todo']
+ _logger.info('getting next %s', Todos)
+ active_todo = Todos.search([('state', '=', 'open')], limit=1)
+ if active_todo:
+ _logger.info('next action is %s', active_todo)
+ return active_todo.action_launch()
+ return {
+ 'type': 'ir.actions.act_url',
+ 'target': 'self',
+ 'url': '/web',
+ }
+
@api.multi
def _button_immediate_function(self, function):
function(self)
@@ -489,7 +506,7 @@ class Module(models.Model):
self._cr.commit()
env = api.Environment(self._cr, self._uid, self._context)
- config = env['res.config'].next() or {}
+ config = self.next() or {}
if config.get('type') not in ('ir.actions.act_window_close',):
return config