From a5281de40efbf42898ed8185bac025b2223c6bce Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Mon, 3 Feb 2020 11:28:11 +0000 Subject: [PATCH] [FIX] web_editor: always notify snippet option 'reset' after 'preview' Some code was added to prevent notifying a 'reset' if there was no 'preview' before. Unfortunately, checking "if there was a 'preview' before" cannot be done properly so some 'reset' were stopped while they should not have. This commit simply removes the code which is in fact not needed. closes odoo/odoo#44499 Signed-off-by: Quentin Smetz (qsm) --- addons/web_editor/static/src/js/editor/snippets.options.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/addons/web_editor/static/src/js/editor/snippets.options.js b/addons/web_editor/static/src/js/editor/snippets.options.js index fc27456f3b2..02f994fdeb2 100644 --- a/addons/web_editor/static/src/js/editor/snippets.options.js +++ b/addons/web_editor/static/src/js/editor/snippets.options.js @@ -339,13 +339,9 @@ const UserValueWidget = Widget.extend({ return; } - // Don't notify a reset update if the widget was not previewed before. - const isPreviewed = this.isPreviewed(); - if (previewMode === 'reset' && !isPreviewed) { - return; - } // In the case we notify a change update, force a preview update if it // was not already previewed + const isPreviewed = this.isPreviewed(); if (!previewMode && !isPreviewed) { this.notifyValueChange(true); }