Naresh(OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-bug-891544-nch into 
lp:openobject-addons.

Requested reviews:
  OpenERP R&D Team (openerp-dev)
  Vo Minh Thu (OpenERP) (vmt-openerp)
  Olivier Dony (OpenERP) (odo-openerp)
Related bugs:
  Bug #891544 in OpenERP Server: "Incorect format of report in OpenOffice"
  https://bugs.launchpad.net/openobject-server/+bug/891544

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-891544-nch/+merge/83571
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-891544-nch/+merge/83571
Your team OpenERP R&D Team is requested to review the proposed merge of 
lp:~openerp-dev/openobject-addons/trunk-bug-891544-nch into 
lp:openobject-addons.
=== modified file 'base_report_designer/base_report_designer.py'
--- base_report_designer/base_report_designer.py	2011-01-14 09:34:28 +0000
+++ base_report_designer/base_report_designer.py	2011-11-28 10:18:25 +0000
@@ -59,9 +59,17 @@
         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, 

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to