From a9a2fba6830bb7f1eaf14c6155b5dace10bb9c03 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Mon, 18 Nov 2019 11:30:50 +0000 Subject: [PATCH] [FIX] web_editor: remove forced source mode In e29c08969 source mode was reintroduced. Since complex template seemed broken when it was edited, the feature of forcing source mode when there is a `% if ` or `% set` template directive of 12.3 was reintroduced. Since the direct breaking of the template was mostly solved with the added line: `options.prettifyHtml = false;` the force source mode is not so much necessary and there was report that it was not very clear. In this commit it is removed, and if necessary could be reintroduced later with clearer implementation. opw-2123730 fix #40410 closes #40421 closes odoo/odoo#40458 X-original-commit: be30a3ba431cf24a5fcfdfedd0f9d9f73163c717 Signed-off-by: Nicolas Lempereur (nle) --- addons/web_editor/static/src/js/backend/field_html.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/addons/web_editor/static/src/js/backend/field_html.js b/addons/web_editor/static/src/js/backend/field_html.js index 28613d9e0a7..5b98ef8e7c3 100644 --- a/addons/web_editor/static/src/js/backend/field_html.js +++ b/addons/web_editor/static/src/js/backend/field_html.js @@ -485,12 +485,6 @@ var FieldHtml = basic_fields.DebouncedField.extend(TranslatableFieldMixin, { top: '+5px', }); this.$el.append($button); - // force source editor if it contains multiline Jinja directives - if (jinjaRegex.test(this._getValue())) { - var layoutInfo = $.summernote.core.dom.makeLayoutInfo(this.wysiwyg.$editor); - layoutInfo.toolbar().hide(); - $.summernote.pluginEvents.codeview(undefined, undefined, layoutInfo, true); - } }, /** * @private