From 3eddcee5c117e6123ea010de517d9074c2c8161b Mon Sep 17 00:00:00 2001 From: Benoit Socias Date: Wed, 13 Mar 2024 10:42:23 +0100 Subject: [PATCH] [FIX] website_mass_mailing: hide thanks option for newsletter form When configuring a Newsletter Block snippet to display a subscription form, the option to decide whether a message must be displayed is only available when "On Success" is set to "Show Message" through the button beside that option. Unfortunately, the general option for the "Thanks" message is not disabled for other "On Success" values, for which no outcome can display a message. Trying to combine these triggered an error. This commit fixes this problem by hiding the "Display Thanks Button" option when the "Form Subscription" template is selected. Steps to produce: - Install `website_mass_mailing`. - Drop a "Newsletter Block" snippet. - Change template to "Form Subscription". - Click on "Subscribe" button. - Change "On Success" to "Nothing". - Click on "Display Thanks Button". => An error was displayed. task-3748574 closes odoo/odoo#157739 X-original-commit: b090d68894fb96a73df230e021e516e6df22f40e Signed-off-by: Romain Derie (rde) Signed-off-by: Benoit Socias (bso) --- .../static/src/js/website_mass_mailing.editor.js | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/website_mass_mailing/static/src/js/website_mass_mailing.editor.js b/addons/website_mass_mailing/static/src/js/website_mass_mailing.editor.js index 0454a2f819b..0e6d013ba5e 100644 --- a/addons/website_mass_mailing/static/src/js/website_mass_mailing.editor.js +++ b/addons/website_mass_mailing/static/src/js/website_mass_mailing.editor.js @@ -107,6 +107,7 @@ options.registry.mailing_list_subscribe = options.Class.extend({ checkboxEl.setAttribute('string', _t("Display Thanks Button")); checkboxEl.dataset.toggleThanksButton = 'true'; checkboxEl.dataset.noPreview = 'true'; + checkboxEl.dataset.dependencies = "!form_opt"; uiFragment.appendChild(checkboxEl); }, });