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.

1

How to display file name of a binary file? [Solved]

By
Anirudh Lou
on 12/3/14, 10:54 PM 547 views

Hello every one here i am again, Does anyone knows how to display filename of a binary file? I tried to make it downloadable but upon the execution of the wizzard it shows only the "Download" without its filename and upon downloading it's filename become the name of my class plus there is no file extension. The downloaded file is something like this: custom_report_1 (i want to bear it's filename base on how i set it and it's extension). How can i resolve this? Pls help.

0

Sudhir Arya (SA)

--Sudhir Arya (SA)--
10150
| 6 8 8
Ahmedabad, India
--Sudhir Arya (SA)--

Working as an OpenERP/Odoo developer and a Team Leader 

Top 5 Odoo contributor On Stackoverflow

LinkedIn

Blog

Stackoverflow

Sudhir Arya (SA)
On 8/7/16, 12:15 PM

You have to create a char field and then link it with binary field in xml file using filename attribute.

Ex:

# create a char field
file_data = fields.Binary('File')
file_name = fields.Char('File Name')

# Go to xml and
<field name="file_data" filename="file_name"/>
<field name="file_name" invisible="1"/>
0
David Baramidze
On 8/5/16, 1:28 PM

How you solved this problem?

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: 12/3/14, 10:54 PM
Seen: 547 times
Last updated: 8/8/16, 1:55 AM