Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
8583 มุมมอง

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?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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?

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.

ผู้เขียน

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

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

ผู้เขียน

@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.

คำตอบที่ดีที่สุด

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 ?

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ก.พ. 25
1436
0
ม.ค. 25
1206
Field service upgrade แก้ไขแล้ว
1
ธ.ค. 24
1579
1
มิ.ย. 22
5746
2
ธ.ค. 23
25473