Improvement for the report designer
authorFabien Pinckaers <fp@tinyerp.com>
Wed, 1 Aug 2007 09:19:58 +0000 (09:19 +0000)
committerFabien Pinckaers <fp@tinyerp.com>
Wed, 1 Aug 2007 09:19:58 +0000 (09:19 +0000)
bzr revid: fp@tinyerp.com-264cf77957c990b4ca4d2b969dff8b2682d3a53d

addons/base_report_designer/base_report_designer.py

index 8c557bc..7d9ac22 100644 (file)
@@ -29,6 +29,7 @@
 from osv import fields,osv
 from wizard.tiny_sxw2rml import sxw2rml
 from StringIO import StringIO
+import base64
 
 class report_xml(osv.osv):
        _inherit = 'ir.actions.report.xml'
@@ -45,6 +46,11 @@ class report_xml(osv.osv):
                        'report_sxw_content': base64.decodestring(file_sxw),
                        'report_rml_content': str(sxw2rml(sxwval, xsl=fp.read()))
                })
-               return {}
-
+               return True
+       def report_get(self, cr, uid, report_id, context={}):
+               report = self.browse(cr, uid, report_id, context)
+               return {
+                       'report_sxw_content': report.report_sxw_content and base64.encodestring(report.report_sxw_content) or False,
+                       'report_rml_content': report.report_rml_content and base64.encodestring(report.report_rml_content) or False
+               }
 report_xml()