diff --git a/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js b/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js index f51e9d3b434..b5da8e40196 100644 --- a/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js +++ b/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js @@ -1534,6 +1534,7 @@ export class OdooEditor extends EventTarget { const node = this.idFind(mutation.id); if (node) { node.remove(); + node.ouid = undefined; } } } diff --git a/addons/web_editor/static/src/js/editor/odoo-editor/test/spec/editor.test.js b/addons/web_editor/static/src/js/editor/odoo-editor/test/spec/editor.test.js index f3f03485976..755b07237c2 100644 --- a/addons/web_editor/static/src/js/editor/odoo-editor/test/spec/editor.test.js +++ b/addons/web_editor/static/src/js/editor/odoo-editor/test/spec/editor.test.js @@ -4859,6 +4859,34 @@ X[] }) }); }); + describe('undo', () => { + it('should be able to write after undo', async () => { + await testEditor(BasicEditor, { + contentBefore: '
[]
', + stepFunction: async editor => { + editor.execCommand('columnize', 2); + undo(editor); + await insertText(editor, 'x'); + }, + contentAfter: 'x[]
', + }); + }); + it('should work properly after undo and then redo', async () => { + await testEditor(BasicEditor, { + contentBefore: '[]
', + stepFunction: async editor => { + editor.execCommand('columnize', 2); + undo(editor); + redo(editor); + await insertText(editor, 'x'); + }, + contentAfter: columnsContainer( + column(6, 'x[]
') + + column(6, '