diff --git a/addons/mail/static/src/js/chatter.js b/addons/mail/static/src/js/chatter.js index 33a54ca8fc4..7a3bc8adf9a 100644 --- a/addons/mail/static/src/js/chatter.js +++ b/addons/mail/static/src/js/chatter.js @@ -155,6 +155,7 @@ var Chatter = Widget.extend(chat_mixin, { record_name: this.record_name, default_body: old_composer && old_composer.$input && old_composer.$input.val(), default_mention_selections: old_composer && old_composer.mention_get_listener_selections(), + attachment_ids: (old_composer && old_composer.get('attachment_ids')) || [], }); this.composer.on('input_focused', this, function () { this.composer.mention_set_prefetched_partners(this.mentionSuggestions || []); diff --git a/addons/mail/static/src/js/composer.js b/addons/mail/static/src/js/composer.js index a235eb04d46..b1c178b2aae 100644 --- a/addons/mail/static/src/js/composer.js +++ b/addons/mail/static/src/js/composer.js @@ -389,7 +389,7 @@ var BasicComposer = Widget.extend(chat_mixin, { // Attachments this.AttachmentDataSet = new data.DataSetSearch(this, 'ir.attachment', this.context); this.fileupload_id = _.uniqueId('o_chat_fileupload'); - this.set('attachment_ids', []); + this.set('attachment_ids', options.attachment_ids || []); // Mention this.mention_manager = new MentionManager(this); @@ -449,6 +449,7 @@ var BasicComposer = Widget.extend(chat_mixin, { dom.autoresize(this.$input, {parent: this, min_height: this.options.input_min_height}); // Attachments + this.render_attachments(); $(window).on(this.fileupload_id, this.on_attachment_loaded); this.on("change:attachment_ids", this, this.render_attachments);