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?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
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 ?
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
0
thg 2 25
|
1445 | ||
|
0
thg 1 25
|
1211 | ||
Field service upgrade
Đã xử lý
|
|
1
thg 12 24
|
1589 | |
|
1
thg 6 22
|
5765 | ||
|
2
thg 12 23
|
25478 |