[FIX] mail: reload the record when uploading attachments if post_refresh is set to always

When post_refresh is set to 'always', the displayed record is entirely reloaded
each time a message is posted in the chatter.
However no such thing exists for when attachments are uploaded.

This is of use e.g. when in the view there are fields that have attributes that
depend on computed fields, themselves dependent on the record's attachments.

One such case is the OCR.

opw 1950403
This commit is contained in:
Nans Lefebvre
2019-04-05 13:42:55 +00:00
parent c791981abc
commit 6a5dab9c64
+4
View File
@@ -81,6 +81,7 @@ var Chatter = Widget.extend({
var nodeOptions = fieldsInfo[mailFields.mail_thread].options || {};
this.hasLogButton = options.display_log_button || nodeOptions.display_log_button;
this.postRefresh = nodeOptions.post_refresh || 'never';
this.reloadOnUploadAttachment = this.postRefresh === 'always';
}
},
/**
@@ -572,6 +573,9 @@ var Chatter = Widget.extend({
* @private
*/
_onReloadAttachmentBox: function () {
if (this.reloadOnUploadAttachment) {
this.trigger_up('reload');
}
this._reloadAttachmentBox();
},
/**