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 binary field works in oe?

By
fussions
on 3/28/14, 6:24 PM 2,465 views

I've put binary field in my module to store PDF files. In form view I have a nice widget to load files. With this I can choose a PDF file from my disk and upload it to the openerp database. But when I try to download the uploaded file instead of PDF file I get a BIN (binary) file. Is it necessary to programatically treat (encode, decode, etc) uploads or downloads of files? If yes how, and why Openerp doesn't handle basic files extensions like PDF?

0

Nehal

--Nehal--
2090
| 5 2 8
Ahmadabad, India
--Nehal--
Nehal
On 3/29/14, 12:59 AM

HI,

This link may help you for attachment name of the binary field: https://launchpadlibrarian.net/159472780/main.py.patch

Do you think it is a problem of a name? In which method I should use the code?

fussions
on 3/29/14, 7:09 AM

line : 1315 of the your_addons/web/controllers/main.py file. After applying this patch, when you download the file, it will give the original name of file.

Nehal
on 3/29/14, 7:19 AM

Looks like I've found what you gave :) https://bugs.launchpad.net/openerp-web/+bug/1252458

fussions
on 3/29/14, 2:41 PM

Yes, this is the bug link also given in the code of the link I have given. :) Hope your problem will be solved.

Nehal
on 3/31/14, 1:44 AM

@Nehal, your suggestion was helpfull, although I wasn't able to achieve desired behaviour with binary field. Instead I've used many2one relation to ir_attachment model.

fussions
on 3/31/14, 7:28 AM
0
Toky RABESON
On 4/4/14, 7:42 AM

Hi,

I have the same problem. But I'm in Saas, I don't have access to source code. Any one have an other solution ?

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

1 follower(s)

Stats

Asked: 3/28/14, 6:24 PM
Seen: 2465 times
Last updated: 1/5/16, 10:22 PM