diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-02-12 18:34:43 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-02-12 18:34:43 +0100 |
| commit | adeea2a88db4443b2b426877a28bb1471c2f5db1 (patch) | |
| tree | 2f43fecc9649947d3061e8c482219fa167b3385a /addons/mail/models/mail_message.py | |
| parent | 317f5f11112266128ac2292ecfafcd92cda74fd0 (diff) | |
| parent | 0f02dcb63918228d48df50f2d5805b7fda25c14a (diff) | |
[MERGE] forward port branch saas-11.2 up to 0f02dcb6391
Diffstat (limited to 'addons/mail/models/mail_message.py')
| -rw-r--r-- | addons/mail/models/mail_message.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/addons/mail/models/mail_message.py b/addons/mail/models/mail_message.py index 0d855dd15de..724f78ed827 100644 --- a/addons/mail/models/mail_message.py +++ b/addons/mail/models/mail_message.py @@ -749,9 +749,10 @@ class Message(models.Model): 'datas_fname': name, 'res_model': 'mail.message', }) + attachment.generate_access_token() values['attachment_ids'].append((4, attachment.id)) - data_to_url[key] = '/web/image/%s' % attachment.id - return '%s%s alt="%s"' % (data_to_url[key], match.group(3), name) + data_to_url[key] = ['/web/image/%s?access_token=%s' % (attachment.id, attachment.access_token), name] + return '%s%s alt="%s"' % (data_to_url[key][0], match.group(3), data_to_url[key][1]) values['body'] = _image_dataurl.sub(base64_to_boundary, tools.ustr(values['body'])) # delegate creation of tracking after the create as sudo to avoid access rights issues |
