From 06e4a32f5badd0ea45d8ed536e86c42617671df2 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 30 Jul 2007 13:50:38 +0000 Subject: [PATCH] Projects - Add a menu entry: My pending tasks Report Designer - Add an item to add a new report bzr revid: fp@tinyerp.com-e14ca9e9f8f322cb0a1255c70abed93d48116101 --- bin/addons/base/ir/ir_actions.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/bin/addons/base/ir/ir_actions.py b/bin/addons/base/ir/ir_actions.py index 8cdc79df521..2826e00eb0b 100644 --- a/bin/addons/base/ir/ir_actions.py +++ b/bin/addons/base/ir/ir_actions.py @@ -109,6 +109,20 @@ class report_xml(osv.osv): 'header': lambda *a: True, 'report_sxw_content': lambda *a: False, } + # + # Untested function + # + def upload_report(self, cr, uid, report_id, file_sxw, context): + import tiny_sxw2rml + import StringIO + pool = pooler.get_pool(cr.dbname) + sxwval = StringIO.StringIO(base64.decodestring(file_sxw)) + fp = tools.file_open('normalized_oo2rml.xsl',subdir='addons/base_report_designer/wizard/tiny_sxw2rml') + report = pool.get('ir.actions.report.xml').write(cr, uid, [report_id], { + 'report_sxw_content': base64.decodestring(file_sxw), + 'report_rml_content': str(tiny_sxw2rml.sxw2rml(sxwval, xsl=fp.read())) + }) + return {} report_xml() class act_window(osv.osv):