コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
10773 ビュー

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 ?

関連投稿 返信 ビュー 活動
3
5月 25
3222
0
12月 23
2806
1
7月 23
2895
0
7月 22
2270
2
2月 24
25733