[FIX]:Incorect format of report in OpenOffice

lp bug: https://launchpad.net/bugs/891544 fixed

bzr revid: nch@tinyerp.com-20111128100823-0pllyv7qivnlesuk
This commit is contained in:
Naresh (OpenERP)
2011-11-28 15:38:23 +05:30
parent 847bddb3e5
commit 90cb2af8d3
@@ -59,9 +59,17 @@ class report_xml(osv.osv):
return True
def report_get(self, cr, uid, report_id, context=None):
if context is None:
context = {}
#we ask osv.fields.sanitize_binary_value() not to encode the binary value"
context.update({'bin_raw':True})
report = self.browse(cr, uid, report_id, context=context)
sxw_data=(report.report_sxw_content).encode("iso-8859-1", "replace")
rml_data= (report.report_rml_content).encode("iso-8859-1", "replace")
sxw_data = report.report_sxw_content
rml_data = report.report_rml_content
if isinstance(report.report_sxw_content, unicode):
sxw_data = (report.report_sxw_content).encode("iso-8859-1", "replace")
if isinstance(report.report_rml_content, unicode):
rml_data = (report.report_rml_content).encode("iso-8859-1", "replace")
return {
'file_type' : report.report_type,
'report_sxw_content': report.report_sxw_content and base64.encodestring(sxw_data) or False,