c2c-oerpscenario team mailing list archive
-
c2c-oerpscenario team
-
Mailing list archive
-
Message #02412
[Bug 623958] Re: Open custom report class(report_int)
Hello Jay,
I tested the new revision and only works in the reports generated osv_memory,
since I'm using the wizard still does not work.
Thanks.
--
Open custom report class(report_int)
https://bugs.launchpad.net/bugs/623958
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
Status in OpenObject Web Client: Fix Released
Bug description:
When I generate the report inheriting a custom class (report_int)
Instead of downloading the pdf. The file opens in the browser.
My Code:
class external_pdf(render):
def __init__(self, pdf):
render.__init__(self)
self.pdf = pdf
self.output_type = 'pdf'
def _render(self):
return self.pdf
class report_custom(report_int):
def create(self, cr, uid, ids, datas, context={}):
pdf_string = StringIO.StringIO()
...
Code for draw report
...
self.obj = external_pdf(pdf_string.getvalue())
self.obj.render()
pdf_string.close()
return (self.obj.pdf, 'pdf')
report_custom('report.listagem_categoria')
class wizard_listagem_categoria(wizard.interface):
states = {
'init': {
'actions':[],
'result': {
'type': 'print',
'report': 'listagem_categoria',
'state': 'end'
}
},
}
wizard_listagem_categoria('wizard.listagem_categoria')
This error only occurs when I call the wizard for menuitem
bzr revno 3131 of branch