Odoo Help

0
4 Answers
1
Avatar

Niyas Raphy

--Niyas Raphy--
14436
| 6 6 9
Calicut, India
--Niyas Raphy--

Odoo Techno Functionalist

Feel free to connect :  niyasraphyk@gmail.com

Twitter:https://twitter.com/niyasraphy
LinkedIn: https://www.linkedin.com/in/niyasraphy/
FB:https://www.facebook.com/niyasraphy123

Happy to help :)

Niyas Raphy
8/8/18, 8:49 PM
0
Sehrish
8/9/18, 12:14 AM
xlsx_data = output.getvalue()    
return request.make_response(xlsx_data,
[('Content-Type', 'application/vnd.ms-excel'),
('Content-Disposition', content_disposition(str(section_name)+'.xlsx'))])

Hope this will heps you


0
HLX Studios
8/8/18, 5:44 PM

First save, then close

    workbook.save()
workbook.close()

That will save the file.  By the looks of it, you didn't specify a file path so it will be in whatever directory the Python script is in.  I would use `tempfile` to store into a temporary directory.  If you need the file path, you can then return that.  If not, you can use open in read-binary & return the file in binary.

1 Comment
Mohamed Lamine Lalmi
8/8/18, 5:47 PM

And what should i return ?

Ask a Question
Keep Informed
1 follower(s)
About This Community

This platform 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.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now