diff options
| author | P. Christeas <p_christ@hol.gr> | 2008-12-13 01:16:18 +0200 |
|---|---|---|
| committer | P. Christeas <p_christ@hol.gr> | 2008-12-13 01:16:18 +0200 |
| commit | a52ccd2c3f342106d2d0c720c685a56975689cef (patch) | |
| tree | 6bd6d43d4e8570c5da05ea2504c71e457e653e14 /bin/report/interface.py | |
| parent | 09866d0444473bf822fa106a929819745b813a5b (diff) | |
Use the txt report in the OpenObject server
Activate that report type, so that the server can use it.
bzr revid: p_christ@hol.gr-20081212231618-fkk5wd7bja0dih45
Diffstat (limited to 'bin/report/interface.py')
| -rw-r--r-- | bin/report/interface.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/bin/report/interface.py b/bin/report/interface.py index eb82025cd19..3623efbd4e2 100644 --- a/bin/report/interface.py +++ b/bin/report/interface.py @@ -81,15 +81,16 @@ class report_rml(report_int): 'html': self.create_html, 'raw': self.create_raw, 'sxw': self.create_sxw, + 'txt': self.create_txt, } def create(self, cr, uid, ids, datas, context): xml = self.create_xml(cr, uid, ids, datas, context) -# file('/tmp/terp.xml','wb+').write(xml) + #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) + #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: @@ -208,6 +209,11 @@ class report_rml(report_int): obj.render() return obj.get() + def create_txt(self, xml, logo=None, title=None): + obj = render.rml2txt(xml, self.bin_datas) + obj.render() + return obj.get().encode('utf-8') + def create_raw(self, xml, logo=None, title=None): return xml @@ -235,4 +241,3 @@ def register_all(db): # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - |
