From 595daa884ad67f9996a38f4cfb7abf56a631552d Mon Sep 17 00:00:00 2001 From: Nicolas Bayet Date: Wed, 6 Apr 2022 14:49:14 +0000 Subject: [PATCH] [FIX] web_editor: make o_editable unremovable `o_editable` is not supposed to be removed. Example of a problem if o_editable can be removed: In translation mode, when deleting the text of the `o_editable` container, that container could be removed but shouldn't. See https://drive.google.com/file/d/1U_NUFBvUninOuFKn2H2c4BDcka3OetlD/view task-2810332 closes odoo/odoo#89071 X-original-commit: 2010c0e2c402f5bb423a0fe683e51923e1e14042 Signed-off-by: David Monjoie (dmo) --- addons/web_editor/static/lib/odoo-editor/src/utils/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_editor/static/lib/odoo-editor/src/utils/utils.js b/addons/web_editor/static/lib/odoo-editor/src/utils/utils.js index a79bb581e07..feb006b1221 100644 --- a/addons/web_editor/static/lib/odoo-editor/src/utils/utils.js +++ b/addons/web_editor/static/lib/odoo-editor/src/utils/utils.js @@ -965,7 +965,7 @@ export function isUnremovable(node) { return ( node.oid === 'root' || (node.nodeType === Node.ELEMENT_NODE && - (node.getAttribute('t-set') || node.getAttribute('t-call'))) || + (node.classList.contains('o_editable') || node.getAttribute('t-set') || node.getAttribute('t-call'))) || (node.classList && node.classList.contains('oe_unremovable')) ); }