[FIX] base: ir.qweb: ensure element.tail is correctly encoded
element.{text,tail} are either ascii-compatible `str`, or `unicode` when non-ascii-compatible. This could force the implicit decoding of utf-8 encoded contents when joining template bits, breaking the rendering. Fixes #1085, and related to #1130
This commit is contained in:
parent
64ed698a58
commit
b64bd885b0
|
@ -289,7 +289,7 @@ class QWeb(orm.AbstractModel):
|
||||||
result = self.render_element(element, template_attributes, generated_attributes, qwebcontext)
|
result = self.render_element(element, template_attributes, generated_attributes, qwebcontext)
|
||||||
|
|
||||||
if element.tail:
|
if element.tail:
|
||||||
result += element.tail
|
result += element.tail.encode('utf-8')
|
||||||
|
|
||||||
if isinstance(result, unicode):
|
if isinstance(result, unicode):
|
||||||
return result.encode('utf-8')
|
return result.encode('utf-8')
|
||||||
|
|
Loading…
Reference in New Issue