From 06807ebdf80f571767da0302470f41d305cb5b78 Mon Sep 17 00:00:00 2001 From: Younn Olivier Date: Mon, 18 Jul 2022 07:28:42 +0000 Subject: [PATCH] [FIX] website: remove loader when installing "new content" module fails Before this commit, if installing a new module from the "new content" modal would fail, the "Building your website" gif was not removed. This commit removes it when the installation fails. task-2687506 closes odoo/odoo#95955 Signed-off-by: Quentin Smetz (qsm) --- .../website/static/src/systray_items/new_content.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/addons/website/static/src/systray_items/new_content.js b/addons/website/static/src/systray_items/new_content.js index 041c2948b8e..f435d622394 100644 --- a/addons/website/static/src/systray_items/new_content.js +++ b/addons/website/static/src/systray_items/new_content.js @@ -152,10 +152,7 @@ export class NewContentModal extends Component { }); } - async installModule(id, redirectUrl, moduleName) { - this.website.showLoader({ - title: sprintf(this.env._t("Building your %s"), moduleName), - }); + async installModule(id, redirectUrl) { await this.orm.silent.call( 'ir.module.module', 'button_immediate_install', @@ -190,9 +187,13 @@ export class NewContentModal extends Component { } return el; }); + this.website.showLoader({ + title: sprintf(this.env._t("Building your %s"), name), + }); try { - await this.installModule(id, element.redirectUrl, name); + await this.installModule(id, element.redirectUrl); } catch (error) { + this.website.hideLoader(); // Update the NewContentElement with failure icon and text. this.state.newContentElements = this.state.newContentElements.map(el => { if (el.moduleXmlId === element.moduleXmlId) {