From 212ed85ac4632b82b97c3cd898fc1e8a8b605fb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20K=C3=BChn?= Date: Tue, 10 Jul 2018 14:10:46 +0200 Subject: [PATCH] [FIX] mail: upload again a same file on the composer Before this commit, it was not possible to upload again a file on the browser from the composer, when it was added then removed from the attachments. When a file is uploaded on the browser, it writes on a special input some data to identify this file. In order to detect a new upload, the code listens on the JQuery event `change` on this input. Since the value of this input was not cleared after an attachment removal, the user couldn't reupload the same file, because the value of the input will be unchanged. This commit solves this issue by clearing the special input when removing an attachment, so that adding the same file again will trigger a `change` on this input. --- addons/mail/static/src/js/composer.js | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/mail/static/src/js/composer.js b/addons/mail/static/src/js/composer.js index 6a83c39d900..a235eb04d46 100644 --- a/addons/mail/static/src/js/composer.js +++ b/addons/mail/static/src/js/composer.js @@ -659,6 +659,7 @@ var BasicComposer = Widget.extend(chat_mixin, { } }); this.set('attachment_ids', attachments); + this.$('input.o_input_file').val(''); } }, do_check_attachment_upload: function () {