From 4900cee8a835a3fa16f3a2c2d6ab68f8dca3733b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Mottet=20=28oms=29?= Date: Tue, 11 May 2021 10:22:37 +0000 Subject: [PATCH] [FIX] website: launch action todo on website creation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When website is installed through CLI, the ir.actions.todo 'website_configurator_todo' is not launched and stays in 'open' state. In this case the FIRST time we create a new website, this ir.action.todo is launched at the end of the configurator wheter it fails or not. - If configurator fails, the ir.actions.todo is returned by button_choose_theme when choosing a theme in the theme_view_kanban view. /website/configurator is called and since configurator_done was not correctly set to true on current website, the screen theme_view_kanban was rendered a second time. - If configurator succeeds, the ir.actions.todo is returned by button_choose_theme in configurator_apply. The route /website/configurator is called a second time and since configurator_done is set to true the route redirect to the website homepage but not in edit mode. The fix consits in correctly setting configurator_done in configurator_skip and in launching the configurator through the ir.actions.todo in create_and_redirect_configurator. closes odoo/odoo#71148 X-original-commit: 1752548fabc9b184b5b67b659b505c4cfe8dc0c7 Signed-off-by: Jérémy Kersten (jke) --- addons/website/models/website.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/website/models/website.py b/addons/website/models/website.py index 266367b8ddc..3b24ec2ee1a 100644 --- a/addons/website/models/website.py +++ b/addons/website/models/website.py @@ -249,8 +249,8 @@ class Website(models.Model): def create_and_redirect_configurator(self): self._force() - action = self.env['ir.actions.actions']._for_xml_id('website.start_configurator_act_url') - return action + configurator_action_todo = self.env.ref('website.website_configurator_todo') + return configurator_action_todo.action_launch() # ---------------------------------------------------------- # Configurator @@ -288,7 +288,8 @@ class Website(models.Model): @api.model def configurator_skip(self): - self.configurator_done = True + website = self.get_current_website() + website.configurator_done = True @api.model def configurator_apply(self, **kwargs):