[IMP] qweb: remove decode('utf-8') in report because qweb return unicode

This commit is contained in:
Christophe Matthieu
2016-06-14 09:46:26 +02:00
parent 956bb2b6e9
commit d159aec83d
2 changed files with 2 additions and 4 deletions
+1 -3
View File
@@ -128,7 +128,7 @@ class Report(osv.Model):
'doc_model': report.model,
'docs': docs,
}
return self.render(cr, uid, [], report.report_name, docargs, context=context)
return self.render(cr, uid, [], report.report_name, docargs, context=context).encode('utf-8')
@api.v8
def get_html(self, records, report_name, data=None):
@@ -163,8 +163,6 @@ class Report(osv.Model):
if isinstance(cr, TestCursor):
return html
html = html.decode('utf-8') # Ensure the current document is utf-8 encoded.
# Get the ir.actions.report.xml record we are working on.
report = self._get_report_from_name(cr, uid, report_name)
# Check if we have to save the report or if we have to get one from the db.
+1 -1
View File
@@ -93,7 +93,7 @@ class QWeb(models.AbstractModel):
if method.startswith('render_'):
_logger.warning("Method '%s' found in ir.qweb, please remove it." % method)
return template_function(qwebcontext).encode('utf-8')
return template_function(qwebcontext)
def get_field_for(self, field_type, cr=None, uid=None, context=None):
""" returns a :class:`~openerp.models.Model` used to render a