[FIX] RAW reports creation corrected
lp bug: https://launchpad.net/bugs/490604 fixed bzr revid: jvo@tinyerp.com-20091201110149-2flhfi59r9t909n4
This commit is contained in:
committed by
Jay (Open ERP)
parent
0858a7c066
commit
bb6e26450e
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user