[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) <qsm@odoo.com>
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user