summaryrefslogtreecommitdiff
path: root/addons/website/models
diff options
context:
space:
mode:
authorJeremy Kersten <jke@odoo.com>2021-01-12 14:40:06 +0000
committerNicolas Lempereur <nle@odoo.com>2021-02-25 15:17:58 +0000
commit38983d123d171ac3cc1efacd99d9776f0ed08734 (patch)
tree81d01e16e6a8b4b88656d121686ed073d5a5faf9 /addons/website/models
parent1b729171c5deac4fadebcff013aa061a96860b09 (diff)
[FIX] base, web_editor, website: add missing encoding on etree.tostring
Since lxml 4.5.0 that use now use libxml2 2.9.10, without it, it can crash. Here sample of content that is broken: https://drive.google.com/file/d/1gB2-jl4fabHscLjH9OZc4WZgtSEbCVj7/view?usp=sharing note: this commit is to merge 3 changes of #64526 opw-2428617 opw-2428664 closes odoo/odoo#66866 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Diffstat (limited to 'addons/website/models')
-rw-r--r--addons/website/models/website_snippet_filter.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/website/models/website_snippet_filter.py b/addons/website/models/website_snippet_filter.py
index 842cdfec372..cd7ed8eb961 100644
--- a/addons/website/models/website_snippet_filter.py
+++ b/addons/website/models/website_snippet_filter.py
@@ -60,7 +60,7 @@ class WebsiteSnippetFilter(models.Model):
records = self._prepare_values(limit, search_domain)
View = self.env['ir.ui.view'].sudo().with_context(inherit_branding=False)
content = View._render_template(template_key, dict(records=records)).decode('utf-8')
- return [ET.tostring(el) for el in ET.fromstring('<root>%s</root>' % content).getchildren()]
+ return [ET.tostring(el, encoding='utf-8') for el in ET.fromstring('<root>%s</root>' % content).getchildren()]
def _prepare_values(self, limit=None, search_domain=None):
"""Gets the data and returns it the right format for render."""