summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Morel <xmo@odoo.com>2018-09-06 16:44:00 +0200
committerXavier Morel <xmo@odoo.com>2018-09-06 16:44:00 +0200
commita3cd0ac2ceaa25cc7ddbbb38e33a43726a0c7ac7 (patch)
tree45d8fc59b56f6de81b3999380b014b4e3a1d9767
parentd3dc5048e40d1aef693336d10ce582d39ce17337 (diff)
[FIX] project: add access token to task attachment display
Following CDN expansion (d98b262398fcf5d14d8e0acd4015a6fb28573155) portal attachment links now go through the CDN, which is an issue for restricted-access attachments e.g. attachments bound to specific objects (such as support tickets). Add an access token to the attachment links in the /my/task template. Cf OPW-1882014 (fixed ad-hoc by editing the relevant view on odoo.com)
-rw-r--r--addons/project/views/project_portal_templates.xml2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/project/views/project_portal_templates.xml b/addons/project/views/project_portal_templates.xml
index 1f24df5cef8..792c1eacfd3 100644
--- a/addons/project/views/project_portal_templates.xml
+++ b/addons/project/views/project_portal_templates.xml
@@ -211,7 +211,7 @@
</strong>
<div class='row'>
<div class="col-md-2 col-sm-3 text-center oe_attachments" t-foreach='task.attachment_ids' t-as='attachment'>
- <a t-attf-href="/web/content/#{attachment.id}?download=true" target="_blank">
+ <a t-attf-href="/web/content/#{attachment.id}?download=true&amp;access_token=#{attachment.generate_access_token()}" target="_blank">
<div class='oe_attachment_embedded o_image o_image_small' 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'><t t-esc='attachment.name' /></div>
</a>