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

I've made a custom_module with a binary field to attach files, and a website_custom_module that shows the info of my custom_module. How can I put a button in my website template to download said attachment?

Any ideas? Thanks in advance!

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

Hi,

Here, an example how to allow user downloading an attachment file from website :

<a class="list-group-item list-group-item-action d-flex align-items-center oe_attachments py-1 px-2" t-foreach='task.attachment_ids' t-as='attachment' t-attf-href="/web/content/#{attachment.id}" target="_blank" data-no-post-process="">
<div class='oe_attachment_embedded o_image o_image_small mr-2 mr-lg-3' t-att-title="attachment.name" t-att-data-mimetype="attachment.mimetype" t-attf-data-src="/web/image/#{attachment.id}/50x40"/>
<div class='oe_attachment_name text-truncate'><t t-esc='attachment.name'/></div>
</a>

Best regards!

อวตาร
ละทิ้ง

I need to put one download button which will download the .exe file associated with that.

How can i do that ?

Related Posts ตอบกลับ มุมมอง กิจกรรม
3
พ.ค. 25
3181
0
ธ.ค. 23
2766
1
ก.ค. 23
2858
0
ก.ค. 22
2225
Add Attachement From website. แก้ไขแล้ว
2
ก.พ. 24
25620