Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Create buttons in wizard + Force download file generated

By
bernscheinder
on 1/13/15, 7:15 AM 1,040 views

Hi,

In Odoo (Openerp 7,8), In need to create an action from wizard that if I click in the action, there is a wizard with a button to generate file.csv. The file is created and attached in the object but I like to force download this file.

Sincerly,

Bern

1
Dorin Hongu
On 4/3/16, 2:05 AM
         wizard = self.env['wizard.name'].with_context({'active_id':self.id}).create({})
return {
'type' : 'ir.actions.act_url',
'url': '/web/binary/saveas?model=wizard.name&field=data_file&id=%s&filename_field=name' % (wizard.id),
'target': 'self',
}

Refer below link http://www.emiprotechnologies.com/technical_notes/odoo-technical-notes-59/post/how-to-download-any-file-on-button-click-244

Ankit H Gandhi(AHG)
on 4/3/16, 6:11 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 1/13/15, 7:15 AM
Seen: 1040 times
Last updated: 4/4/16, 11:13 AM