Regression: template doesn't get base64 decoded

Bug #793884 reported by Dukai Gábor
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Aeroo Reporting library
Won't Fix
Undecided
Unassigned

Bug Description

Hi!
Since I've upgraded to revision 2 of aeroolib, I get the following error when trying to print:

Traceback (most recent call last):
   File "addons/printjob/printjob.py", line 511, in print_thread
     (result, format) = service.create(cr, uid, ids, datas, context)
   File "addons/report_aeroo/report_aeroo.py", line 618, in create
     return fnct(cr, uid, ids, data, report_xml, context)
   File "addons/report_aeroo/report_aeroo.py", line 522, in create_source_pdf
     return self.create_single_pdf(cr, uid, ids, data, report_xml, context)
   File "addons/report_aeroo/report_aeroo.py", line 452, in create_single_pdf
     return self.create_aeroo_report(cr, uid, ids, data, report_xml, context=context, output=output)
   File "addons/report_aeroo/report_aeroo.py", line 375, in create_aeroo_report
     serializer = OOSerializer(template_io, oo_styles=style_io)
   File "aeroolib/plugins/opendocument.py", line 1009, in __init__
     self.inzip = zipfile.ZipFile(self.template)
   File "/usr/lib/python2.6/zipfile.py", line 696, in __init__
     self._GetContents()
   File "/usr/lib/python2.6/zipfile.py", line 716, in _GetContents
     self._RealGetContents()
   File "/usr/lib/python2.6/zipfile.py", line 728, in _RealGetContents
     raise BadZipfile, "File is not a zip file"

This is because self.template is base64 encoded. When I put a base64.decodestring() in OOSerializer.__init__(), it started to work.

Related branches

Revision history for this message
Santiv (rulosanti) wrote :

I have the same problem

<quote>
This is because self.template is base64 encoded. When I put a base64.decodestring() in OOSerializer.__init__(), it started to work.
</quote>

I edited opendocument.py and added "import base64"

I have tried some ways to put base64.decodestring(), base64.decode(self.template, self.template) this but i can't solve it.

Can you show me what you have put exactly?

thanks

Revision history for this message
Dukai Gábor (gdukai) wrote :

I've attached a patch with the workaround.

Revision history for this message
Santiv (rulosanti) wrote :

Thank you! That worked and now i can generate report_aeroo_sample,

now i have a problem with my own report, something with language:

 File "/usr/lib/openerp-server/tools/translate.py", line 138, in __call__
    cr.execute('select value from ir_translation where lang=%s and type=%s and src=%s', (lang, 'code', source))

COMPLETE ERROR:
Environment Information :
System : Linux-2.6.32-32-generic-x86_64-with-Ubuntu-10.04-lucid
OS Name : posix
Distributor ID: Ubuntu
Description: Ubuntu 10.04.2 LTS
Release: 10.04
Codename: lucid
Operating System Release : 2.6.32-32-generic
Operating System Version : #62-Ubuntu SMP Wed Apr 20 21:52:38 UTC 2011
Operating System Architecture : 64bit
Operating System Locale : es_AR.UTF8
Python Version : 2.6.5
OpenERP-Client Version : 5.0.16
Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last):
  File "/usr/lib/openerp-server/service/web_services.py", line 687, in go
    (result, format) = obj.create(cr, uid, ids, datas, context)
  File "/usr/lib/openerp-server/addons/report_aeroo/report_aeroo.py", line 618, in create
    return fnct(cr, uid, ids, data, report_xml, context)
  File "/usr/lib/openerp-server/addons/report_aeroo/report_aeroo.py", line 575, in create_source_odt
    return self.create_single_pdf(cr, uid, ids, data, report_xml, context)
  File "/usr/lib/openerp-server/addons/report_aeroo/report_aeroo.py", line 452, in create_single_pdf
    return self.create_aeroo_report(cr, uid, ids, data, report_xml, context=context, output=output)
  File "/usr/lib/openerp-server/addons/report_aeroo/report_aeroo.py", line 417, in create_aeroo_report
    raise Exception(_("Aeroo Reports: Error while generating the report."), e, str(e), _("For more reference inspect error logs."))
  File "/usr/lib/openerp-server/tools/translate.py", line 138, in __call__
    cr.execute('select value from ir_translation where lang=%s and type=%s and src=%s', (lang, 'code', source))
  File "/usr/lib/openerp-server/sql_db.py", line 76, in wrapper
    return f(self, *args, **kwargs)
  File "/usr/lib/openerp-server/sql_db.py", line 120, in execute
    res = self._obj.execute(query, params)
InternalError: transacción abortada, las órdenes serán ignoradas hasta el fin de bloque de transacción

Revision history for this message
Santiv (rulosanti) wrote :

Comment #3 is not abug. There was a problem in my module installation.
Comment #3 and #4 can be deleted.

Revision history for this message
sraps (Alistek) (erpsraps) wrote :

Code not needed on newer OpenERP revisions

Changed in aeroolib:
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.