From 15e3646b4f91165966aa92be919fb492a5fd4c24 Mon Sep 17 00:00:00 2001 From: Romain Derie Date: Tue, 3 Sep 2019 17:00:12 +0000 Subject: [PATCH] [FIX] website_theme_install,*: redirect to frontend after theme install MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit *: theme_bootswatch, theme_default Before this commit, the first time a website was loading a theme, it would not be redirected to the frontend afterward (even if that theme was already installed on another website). Any other theme installation on that website would redirect to frontend as it should. Indeed, the first time it would use the `act_url` returned by `next()` which would only be called during the first time installation on the website. All the `ir.action.todo` related to themes can be removed anyway, as you can't install directly a theme. It can only be installed through website settings > load a theme. In which case we will always want to redirect to frontend. task-2070463 closes odoo/odoo#37306 Signed-off-by: Jérémy Kersten (jke) --- addons/theme_bootswatch/__manifest__.py | 1 - .../theme_bootswatch/data/theme_bootswatch_data.xml | 12 ------------ addons/theme_default/__manifest__.py | 1 - addons/theme_default/data/theme_default_data.xml | 12 ------------ .../website_theme_install/models/ir_module_module.py | 11 ++--------- 5 files changed, 2 insertions(+), 35 deletions(-) delete mode 100644 addons/theme_bootswatch/data/theme_bootswatch_data.xml delete mode 100644 addons/theme_default/data/theme_default_data.xml diff --git a/addons/theme_bootswatch/__manifest__.py b/addons/theme_bootswatch/__manifest__.py index acefd9511a9..7df84037982 100644 --- a/addons/theme_bootswatch/__manifest__.py +++ b/addons/theme_bootswatch/__manifest__.py @@ -9,7 +9,6 @@ 'version': '1.0', 'depends': ['website', 'website_theme_install'], 'data': [ - 'data/theme_bootswatch_data.xml', 'views/theme_bootswatch_templates.xml', ], 'images': [ diff --git a/addons/theme_bootswatch/data/theme_bootswatch_data.xml b/addons/theme_bootswatch/data/theme_bootswatch_data.xml deleted file mode 100644 index 21e118429f8..00000000000 --- a/addons/theme_bootswatch/data/theme_bootswatch_data.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - Website - / - self - - - - open - - diff --git a/addons/theme_default/__manifest__.py b/addons/theme_default/__manifest__.py index aaac9fa618b..adee84264d2 100644 --- a/addons/theme_default/__manifest__.py +++ b/addons/theme_default/__manifest__.py @@ -9,7 +9,6 @@ 'version': '1.0', 'depends': ['website', 'website_theme_install'], 'data': [ - 'data/theme_default_data.xml', ], 'images': [ 'static/description/cover.png', diff --git a/addons/theme_default/data/theme_default_data.xml b/addons/theme_default/data/theme_default_data.xml deleted file mode 100644 index 21e118429f8..00000000000 --- a/addons/theme_default/data/theme_default_data.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - Website - / - self - - - - open - - diff --git a/addons/website_theme_install/models/ir_module_module.py b/addons/website_theme_install/models/ir_module_module.py index a8eb951fc43..316cb45331b 100644 --- a/addons/website_theme_install/models/ir_module_module.py +++ b/addons/website_theme_install/models/ir_module_module.py @@ -358,17 +358,10 @@ class IrModuleModule(models.Model): self._theme_upgrade_upstream() - next_action = False if self.state != 'installed': - next_action = self.button_immediate_install() + self.button_immediate_install() - # Alter next action for redirect - if not next_action: - next_action = website.button_go_website() - if next_action.get('tag') == 'reload' and not next_action.get('params', {}).get('menu_id'): - next_action = self.env.ref('website.action_website').read()[0] - - return next_action + return website.button_go_website() def button_remove_theme(self): """Remove the current theme of the current website."""