From bb6e26450e975a218434f46ede4b98cb0c701fc8 Mon Sep 17 00:00:00 2001 From: "R.Messier" <> Date: Tue, 1 Dec 2009 16:31:49 +0530 Subject: [PATCH] [FIX] RAW reports creation corrected lp bug: https://launchpad.net/bugs/490604 fixed bzr revid: jvo@tinyerp.com-20091201110149-2flhfi59r9t909n4 --- bin/report/interface.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/report/interface.py b/bin/report/interface.py index 09ea80720ac..cd548301c26 100644 --- a/bin/report/interface.py +++ b/bin/report/interface.py @@ -88,14 +88,14 @@ class report_rml(report_int): def create(self, cr, uid, ids, datas, context): xml = self.create_xml(cr, uid, ids, datas, context) xml = tools.ustr(xml).encode('utf8') - if datas.get('report_type', 'pdf') == 'raw': - return xml + report_type = datas.get('report_type', 'pdf') + if report_type == 'raw': + return (xml,report_type) rml = self.create_rml(cr, xml, uid, context) pool = pooler.get_pool(cr.dbname) ir_actions_report_xml_obj = pool.get('ir.actions.report.xml') report_xml_ids = ir_actions_report_xml_obj.search(cr, uid, [('report_name', '=', self.name[7:])], context=context) self.title = report_xml_ids and ir_actions_report_xml_obj.browse(cr,uid,report_xml_ids)[0].name or 'OpenERP Report' - report_type = datas.get('report_type', 'pdf') create_doc = self.generators[report_type] pdf = create_doc(rml, title=self.title) return (pdf, report_type)