diff options
| author | Christophe Matthieu <chm@odoo.com> | 2018-02-07 14:11:46 +0100 |
|---|---|---|
| committer | Christophe Matthieu <chm@odoo.com> | 2018-02-08 11:25:51 +0100 |
| commit | 6494f511718893eec3573c60c0a62e04d386359d (patch) | |
| tree | ef9c96ef986972d11fd26e240fd4515321909a1c /addons/web_editor/static/src/xml | |
| parent | 152e3f8686ec4f48ba22e5c13f92f72c2640a3b8 (diff) | |
[FIX] base/mail: Added an access_token on the attachments url
The access_token is automatically added by the media editor. It's added
on the website and by the html editor to send by email. The widget display
the attachments from 'ir.ui.view' (public attachment) and the attachment
from the current record.
Issue: can't load image in gmail or mobile because the client mail use a
proxy who avoid ours odoo access.
Diffstat (limited to 'addons/web_editor/static/src/xml')
| -rw-r--r-- | addons/web_editor/static/src/xml/editor.xml | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/addons/web_editor/static/src/xml/editor.xml b/addons/web_editor/static/src/xml/editor.xml index e8e6374305e..8f975b0d784 100644 --- a/addons/web_editor/static/src/xml/editor.xml +++ b/addons/web_editor/static/src/xml/editor.xml @@ -86,6 +86,8 @@ target="fileframe" class="form-inline"> <input type="hidden" name="csrf_token" t-att-value="csrf_token"/> + <input t-if="widget.options.res_id" type="hidden" name="res_id" t-att-value="widget.options.res_id"/> + <input t-if="widget.options.res_model" type="hidden" name="res_model" t-att-value="widget.options.res_model"/> <div class="well"> <div class="form-group pull-left"> <input type="file" name="upload" t-att-accept="widget.accept" multiple="multiple" style="position: absolute; opacity: 0; width: 1px; height: 1px;"/> @@ -145,8 +147,9 @@ <div class="existing-attachments"> <div class="row mt16" t-as="row" t-foreach="rows"> <div class="col-sm-2 o_existing_attachment_cell" t-as="attachment" t-foreach="row"> - <i class="fa fa-times o_existing_attachment_remove" t-att-data-id="attachment.id"/> - <div class="o_attachment_border"><div t-att-data-src="attachment.src" t-att-data-url="attachment.url" t-att-alt="attachment.name" t-att-title="attachment.name" t-att-data-id="attachment.id" t-att-data-mimetype="attachment.mimetype" class="o_image"/></div> + <i t-if="attachment.res_model === 'ir.ui.view'" class="fa fa-times o_existing_attachment_remove" title="This file is a public view attachment" t-att-data-id="attachment.id"/> + <i t-else="" class="fa fa-times o_existing_attachment_remove" title="This file is attached to the current record" t-att-data-id="attachment.id"/> + <div class="o_attachment_border" t-att-style="attachment.res_model === 'ir.ui.view' ? null : 'border: 1px solid #5cb85c;'"><div t-att-data-src="attachment.src" t-att-data-url="attachment.url" t-att-alt="attachment.name" t-att-title="attachment.name" t-att-data-id="attachment.id" t-att-data-mimetype="attachment.mimetype" class="o_image"/></div> </div> </div> </div> |
