From e0cc28dcee977c4aa0c6a7e4ff6c463ab12e55a2 Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Mon, 26 Oct 2020 14:51:38 +0000 Subject: [FIX] web_editor, website, *: improve post install theme and start tour Before this commit, once you install website_* module, the ir.actions.todo from the installed module was overidded by the 'choose a theme' action. Now, when we consume this ir_act_todo, we re-open the open_menu that contains most of the time the expected next action from new module installed. Since we can also install module from the '+ new' button, in frontend, we considere that it first step of tour is to click on it, it is already done and we skip it. Install website_event Before: -> not redirected to /event (the ir.action.todo) -> no tour, if you don't click manually on '+ new' After: -> you are redirected to /event -> you can launch tour from '+ new' if you are already on the new panel, start direclty to the second step 'create event' --- addons/website/models/ir_module_module.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'addons/website/models/ir_module_module.py') diff --git a/addons/website/models/ir_module_module.py b/addons/website/models/ir_module_module.py index ff843663161..9ec53dcc519 100644 --- a/addons/website/models/ir_module_module.py +++ b/addons/website/models/ir_module_module.py @@ -360,7 +360,11 @@ class IrModuleModule(models.Model): # this will install 'self' if it is not installed yet self._theme_upgrade_upstream() - return website.button_go_website(mode_edit=True) + active_todo = self.env['ir.actions.todo'].search([('state', '=', 'open')], limit=1) + if active_todo: + return active_todo.action_launch() + else: + return website.button_go_website(mode_edit=True) def button_remove_theme(self): """Remove the current theme of the current website.""" -- cgit v1.2.3