From deba788b4cdc22bb50e0c19adb5ed35ed33c0a01 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Thu, 10 Aug 2017 13:19:05 +0200 Subject: [FIX] web_editor: html_frame: saving in readonly A form view record may be saved even if the record is displayed in readonly (e.g. when a button in the form view is clicked). When this happened, if there were an html field with html_frame widget in the form, it crashed (e.g. in Email Marketing > Mass Mailings > open one > click on Test Mailing). --- addons/web_editor/static/src/js/backend.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web_editor/static/src') diff --git a/addons/web_editor/static/src/js/backend.js b/addons/web_editor/static/src/js/backend.js index 06053dd1cea..6b167c59edd 100644 --- a/addons/web_editor/static/src/js/backend.js +++ b/addons/web_editor/static/src/js/backend.js @@ -383,7 +383,7 @@ var FieldTextHtml = AbstractField.extend({ * @override */ commitChanges: function () { - if (!this.loaded) { + if (!this.loaded || this.mode === 'readonly') { return; } // switch to WYSIWYG mode if currently in code mode to get all changes -- cgit v1.2.3