diff --git a/attachment_preview/static/src/js/attachment_preview.js b/attachment_preview/static/src/js/attachment_preview.js
index 51c6ef06..0bbeb7d5 100644
--- a/attachment_preview/static/src/js/attachment_preview.js
+++ b/attachment_preview/static/src/js/attachment_preview.js
@@ -153,6 +153,7 @@ openerp.attachment_preview = function(instance)
})
.get(),
$elements.attr('data-field'),
+ $elements.attr('data-filename'),
],
{})
.then(function(extensions)
@@ -181,12 +182,13 @@ openerp.attachment_preview = function(instance)
{
var link = this._super.apply(this, arguments);
link += _.template(
- '
',
+ '
',
{
preview_id: options.id,
preview_text: _t('Preview'),
preview_model: options.model,
preview_field: this.id,
+ preview_filename: this.filename or '',
});
return link;
}