Skip to content

Commit 53d1f56

Browse files
committed
[FIX] util/records: do not fail editing views on extra whitespace
XML parser would fail if there are extra context before the document declaration. Even though it's invalid XML we can still attempt to edit the views. closes #50 Signed-off-by: Christophe Simonis (chs) <[email protected]>
1 parent 3ba8517 commit 53d1f56

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/util/records.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def edit_view(cr, xmlid=None, view_id=None, skip_if_not_noupdate=True, active=Tr
203203

204204
def parse(arch):
205205
arch = arch.encode("utf-8") if isinstance(arch, unicode) else arch
206-
return lxml.etree.fromstring(arch.replace(b"&#13;\n", b"\n"))
206+
return lxml.etree.fromstring(arch.replace(b"&#13;\n", b"\n").strip())
207207

208208
if jsonb_column:
209209

0 commit comments

Comments
 (0)