[FIX] mail: allow uploading same attachment twice
Before this commit, when uploading an attachment then delete then re-upload attachment again, the reupload was unsuccessful. This happens because it should clear the `<input>` of type `file`, but the condition was wrong and therefore `<input>` was not cleared, thus keeping same value as before so input was not detected as changed. A change on this file input is necessary to detect user interaction file upload. This commit fixes trigger for clearing the `<input>` of type file, so that any file upload is properly detected, including uploading same attachment. Task-3060429 closes odoo/odoo#105465 X-original-commit: 97f445ae15663486d0100d7127287f9ec3d1d4cc Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is contained in:
@@ -38,13 +38,12 @@ Model({
|
||||
if (!this.exists()) {
|
||||
return;
|
||||
}
|
||||
if (this.fileInput && this.fileInput.el) {
|
||||
this.fileInput.el.value = '';
|
||||
}
|
||||
if (this.chatterOwner && !this.chatterOwner.hasAttachmentBox) {
|
||||
this.chatterOwner.openAttachmentBox();
|
||||
}
|
||||
this.messaging.messagingBus.trigger('o-file-uploader-upload', { files });
|
||||
// clear at the end because side-effect of emptying `files`
|
||||
this.fileInput.value = '';
|
||||
},
|
||||
/**
|
||||
* @private
|
||||
|
||||
Reference in New Issue
Block a user