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

how to make xlsx file as downloadable

By
Maniganda
on 7/1/13, 6:30 AM 980 views

i have create the xlsx file from openerp and i need to send to browser when i click button and make it as downloadable how can i achieve this

1

Maniganda

--Maniganda--
1038
| 5 7 7
Bangalore, India
--Maniganda--
Maniganda
On 7/3/13, 2:39 AM

Finally i found out the answer how to make a file as downloadable

insert the contents of the file in ir.attachment object and give return as attach_id = self.pool.get('ir.attachment').create(cr, uid, data_attach) return { 'type': 'ir.actions.act_url', 'url': "http://localhost:8080/openerp/attachment/get_data?record="+str(attach_id), 'nodestroy': True, 'target': 'new' }

data_attach = {'name':'filename.xlsx', 'datas':base64.encodestring(contents), 'datas_fname':'filename.xlsx', 'description':'description', 'res_id':current record id}

here attach_id is newly created record in ir.attachment and i have customised get method to get_data in web module we can use like this return { 'type': 'ir.actions.act_url', 'url': "http://localhost:8080/openerp/attachment/get?record="+str(attach_id),

Hello Sir, Can you please provide me some guidelines as to how you customized the get method. Thanks..

Tarun Behal
on 7/6/13, 10:12 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

0 follower(s)

Stats

Asked: 7/1/13, 6:30 AM
Seen: 980 times
Last updated: 3/16/15, 8:10 AM