Open custom report class(report_int)

Bug #623958 reported by Christian Douglas Alcântara
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Web Client
Fix Released
Undecided
Vaibhav Darji

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

Revision history for this message
Christian Douglas Alcântara (christian-douglas-alcantara) wrote :
Changed in openobject-client-web:
status: New → Confirmed
status: Confirmed → In Progress
Changed in openobject-client-web:
assignee: nobody → vda(Open ERP) (vda-tiny)
Revision history for this message
Vaibhav Darji (vaibhav-openerp) wrote :

Hello,

It has been fixed in trunk at revision no: 3217.
<email address hidden>

Please update your code.

Thanks.

Changed in openobject-client-web:
status: In Progress → Fix Committed
milestone: none → 6.0
Revision history for this message
Marcilene Ribeiro (mrasistemas) wrote :

I tested this new revision and did not work.

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Marcilene,

Can you check again and respond?

Thanks.

Changed in openobject-client-web:
status: Fix Committed → Fix Released
Revision history for this message
Marcilene Ribeiro (mrasistemas) wrote :

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.

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Thanks for the feedback, I will make it checked soon.

Revision history for this message
Dhruti Shastri(OpenERP) (dhs-openerp) wrote :

Hello Marcilene,

I tried at my end but but I could not meet to any error.

Can you please attach the module you are working with ?

Thanks.

Revision history for this message
Marcilene Ribeiro (mrasistemas) wrote :

Hello,
tracking module attached.

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.