summaryrefslogtreecommitdiff
path: root/bin/report/interface.py
diff options
context:
space:
mode:
authorStephane Wirtel <stephane@tinyerp.com>2008-12-10 22:55:49 +0100
committerStephane Wirtel <stephane@tinyerp.com>2008-12-10 22:55:49 +0100
commit424ba1e7cd874d79ffefc453bdef30288c63bf1f (patch)
treed42dc9440e76a28d312407c1c6212e50022d2577 /bin/report/interface.py
parenta1d6019076ddd338c54136d4a5bfa0dcd7e0b8cb (diff)
[REF] Remove the unused code and print statement
bzr revid: stephane@tinyerp.com-20081210215549-yxxdiz0x4uc6ozkr
Diffstat (limited to 'bin/report/interface.py')
-rw-r--r--bin/report/interface.py21
1 files changed, 7 insertions, 14 deletions
diff --git a/bin/report/interface.py b/bin/report/interface.py
index eb82025cd19..8b303e473aa 100644
--- a/bin/report/interface.py
+++ b/bin/report/interface.py
@@ -77,28 +77,21 @@ class report_rml(report_int):
self.xsl = xsl
self.bin_datas = {}
self.generators = {
- 'pdf': self.create_pdf,
- 'html': self.create_html,
- 'raw': self.create_raw,
- 'sxw': self.create_sxw,
- }
+ 'pdf': self.create_pdf,
+ 'html': self.create_html,
+ 'raw': self.create_raw,
+ 'sxw': self.create_sxw,
+ }
def create(self, cr, uid, ids, datas, context):
xml = self.create_xml(cr, uid, ids, datas, context)
-# file('/tmp/terp.xml','wb+').write(xml)
if datas.get('report_type', 'pdf') == 'raw':
return xml
rml = self.create_rml(cr, xml, uid, context)
-# file('/tmp/terp.rml','wb+').write(rml)
pool = pooler.get_pool(cr.dbname)
ir_actions_report_xml_obj = pool.get('ir.actions.report.xml')
- try:
- report_xml_ids = ir_actions_report_xml_obj.search(cr, uid,
- [('report_name', '=', self.name[7:])], context=context)
- self.title = ir_actions_report_xml_obj.browse(cr,uid,report_xml_ids)[0].name
- except:
- print 'Report not Found !'
- self.title = 'Unknown'
+ 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)