[FIX] mail: automatically fetch new attachments

Create an invoice, validate it, print the invoice from the print menu,
as of the paperclip value in the chatter, an attachment has been added.
But if you click on the paperclip, there are no attachments. You need to
reload the page in order to access the attachments.

The problem is the internal flag indicating that all attachments are
fetched is wrong. This fix resets the flag when the paper clip value
changes.

opw-2008344

closes odoo/odoo#34171

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is contained in:
Julien Castiaux
2019-06-17 11:42:55 +00:00
parent 413c8c4d85
commit 324634da3d
+5 -1
View File
@@ -435,7 +435,11 @@ var Chatter = Widget.extend({
*/
_updateAttachmentCounter: function () {
var count = this.record.data.message_attachment_count || 0;
this.$('.o_chatter_attachment_button_count').html(count);
var $element = this.$('.o_chatter_attachment_button_count');
if (Number($element.html()) !== count) {
this._areAttachmentsLoaded = false;
$element.html(count);
}
},
/**
* @private