From 445d4cd97cdf4ba42f1c00eb37c0cbb6a61f9b6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nshimiyimana=20S=C3=A9na?= Date: Fri, 18 Nov 2022 14:08:20 +0000 Subject: [PATCH] [FIX] web_editor: fix codeview toggle ### Steps to reproduce * Enable Dev mode * Open an email template * Open Code View of the template * Click the green button in the top right corner of the content box You should be met with a traceback. opw-3045759 closes odoo/odoo#106408 X-original-commit: 01fb9cab941d9055efbeac738490fe53a91ceccf Signed-off-by: David Monjoie (dmo) --- addons/web_editor/static/src/js/backend/html_field.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/web_editor/static/src/js/backend/html_field.js b/addons/web_editor/static/src/js/backend/html_field.js index cf57010ac4e..e1b1e4d1f09 100644 --- a/addons/web_editor/static/src/js/backend/html_field.js +++ b/addons/web_editor/static/src/js/backend/html_field.js @@ -307,7 +307,7 @@ export class HtmlField extends Component { * * @param {JQuery} $codeview */ - toggleCodeView (el = this.codeViewRef.el) { + toggleCodeView() { this.state.showCodeView = !this.state.showCodeView; this.wysiwyg.odooEditor.observerUnactive('toggleCodeView'); @@ -317,7 +317,7 @@ export class HtmlField extends Component { this.props.update(value); } else { this.wysiwyg.odooEditor.observerActive('toggleCodeView'); - const $codeview = $(el); + const $codeview = $(this.codeViewRef.el); const value = $codeview.val(); this.props.update(value);