From e9f72aa6431ccb8f5dbadbe431d78b71be886141 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20De=20Caluw=C3=A9?= Date: Wed, 15 Dec 2021 15:18:44 +0000 Subject: [PATCH] [FIX] website: never hide countdowns with redirect action in edit mode When editing a countdown with a redirect action, sometimes the countdown block will be hidden when toggling the "Hide countdown at the end" option. The problem is caused by the button that allows previewing and editing the end message of the countdown, this button does not apply in the case of a redirect action though. However, the button can still be activated by selecting a different end action first and switching to the redirect action afterwards, in which case it will incorrectly hide the countdown. task-2638366 closes odoo/odoo#81557 X-original-commit: 7f6ebee33e8a82d7ccdf155c3a543898b187389c Signed-off-by: Quentin Smetz (qsm) --- addons/website/static/src/snippets/s_countdown/options.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/website/static/src/snippets/s_countdown/options.js b/addons/website/static/src/snippets/s_countdown/options.js index 75f8ac9d2e4..6a8979ae2f8 100644 --- a/addons/website/static/src/snippets/s_countdown/options.js +++ b/addons/website/static/src/snippets/s_countdown/options.js @@ -41,6 +41,9 @@ options.registry.countdown = options.Class.extend({ this.$target.toggleClass('hide-countdown', widgetValue === 'message_no_countdown'); } else { const $message = this.$target.find('.s_countdown_end_message').detach(); + if (this.showEndMessage) { + this._onToggleEndMessageClick(); + } if ($message.length) { this.endMessage = $message[0].outerHTML; }