From 47441a922812ef49cb452007e4b25d0cd99aa717 Mon Sep 17 00:00:00 2001 From: fja-odoo Date: Thu, 9 Jan 2020 09:09:55 +0000 Subject: [PATCH] [FIX] web_editor: save all child text nodes of oe_structure elements When saving the content of an oe_structure, the starting text nodes were lost because only the internal *elements* were considered. Ending text nodes were kept since they are considered as the last element's tail by the etree library. task-2040764 closes odoo/odoo#43375 X-original-commit: eb71d25ce965ecdb20c26517627aed5b43f8b990 Signed-off-by: Quentin Smetz (qsm) --- addons/web_editor/models/ir_ui_view.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/web_editor/models/ir_ui_view.py b/addons/web_editor/models/ir_ui_view.py index edda3ba6887..0aefd108432 100644 --- a/addons/web_editor/models/ir_ui_view.py +++ b/addons/web_editor/models/ir_ui_view.py @@ -67,6 +67,7 @@ class IrUiView(models.Model): xpath = etree.Element('xpath', expr="//*[hasclass('oe_structure')][@id='{}']".format(el.get('id')), position="replace") arch.append(xpath) structure = etree.Element(el.tag, attrib=el.attrib) + structure.text = el.text xpath.append(structure) for child in el.iterchildren(tag=etree.Element): structure.append(copy.deepcopy(child))