From 6e2ec9c7d4dcf5dc3ee3619fe1252f0f5ba1e606 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Fri, 5 Jun 2020 15:16:03 +0000 Subject: [PATCH] [FIX] web_editor: ensure a crash during save does not lock the editor An error has been introduced by [1]. Indeed `response.data` does not exist, but `response.message.data` does. However, the whole `if` clause there seems now useless so this commit removes it. The whole file is being refactored anyway with the new editor. [1]: https://github.com/odoo/odoo/commit/ab4000fb3cf8fa54ba714ceceec391b78d73755e#diff-b1b550326b2d36a24e94e52c3901d1fbL513 closes odoo/odoo#52534 Signed-off-by: Quentin Smetz (qsm) --- addons/web_editor/static/src/js/editor/rte.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/addons/web_editor/static/src/js/editor/rte.js b/addons/web_editor/static/src/js/editor/rte.js index 9abfc6b3a70..bf5c0db613d 100644 --- a/addons/web_editor/static/src/js/editor/rte.js +++ b/addons/web_editor/static/src/js/editor/rte.js @@ -510,18 +510,11 @@ var RTEWidget = Widget.extend({ // new rejection with all relevant info var id = _.uniqueId('carlos_danger_'); $el.addClass('o_dirty oe_carlos_danger ' + id); - var html = Boolean(response.data.name); - if (html) { - var msg = $('
', {text: response.message.data.message}).html(); - var data = msg.substring(3, msg.length -2).split(/', u'/); - response.message.data.message = '' + data[0] + '' + data[1]; - } $('.o_editable.' + id) .removeClass(id) .popover({ - html: html, trigger: 'hover', - content: response.message.data.message, + content: response.message.data.message || '', placement: 'auto top', }) .popover('show');