Skip to Content
Menu
This question has been flagged
3 Replies
6399 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

Avatar
Discard
Best Answer
         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',
}
Avatar
Discard

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

Best Answer

 Hi, i have the same problem (i want to download a binary field content). I used the solution of empiro technologies but i end up with 404 error. (I'd like to post a comment but i've not the required karma)

Avatar
Discard