[FIX] web_editor: image name

Add the image name when the image is uploaded.

Complement of commits 886c07dabb and 152e3f8686

opw-1880472
This commit is contained in:
Nicolas Martinelli
2018-09-05 09:10:37 +02:00
committed by Nicolas Martinelli
parent c3812c8e62
commit 88a5d9a000
@@ -286,7 +286,7 @@ var ImageDialog = Widget.extend({
$form.find('.well > span').remove();
$form.find('.well > div').show();
_.each(attachments, function (record) {
record.src = record.url || '/web/image/' + record.id;
record.src = record.url || _.str.sprintf('/web/image/%s/%s', record.id, encodeURI(record.name)); // Name is added for SEO purposes
record.is_document = !(/gif|jpe|jpg|png/.test(record.mimetype));
});
if (error || !attachments.length) {