From af017d95573ca5f233af65d23742738fa4f51e3d Mon Sep 17 00:00:00 2001 From: Benoit Socias Date: Tue, 10 Nov 2020 15:35:39 +0000 Subject: [PATCH] [FIX] portal: detect attachment selection even when same as previous MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this commit selecting the same attachment was not detected, which was a problem when the attachment had been mistakenly removed After this commit when the same attachment is selected several times in a row it still triggers the upload and gets attached https://github.com/odoo/odoo/issues/42364 closes odoo/odoo#62278 X-original-commit: e9b1bca1d48afff8313d106266b02793cf77ab79 Signed-off-by: Jérémy Kersten (jke) --- addons/portal/static/src/js/portal_composer.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/portal/static/src/js/portal_composer.js b/addons/portal/static/src/js/portal_composer.js index 64454ae4ca8..68fb9189207 100644 --- a/addons/portal/static/src/js/portal_composer.js +++ b/addons/portal/static/src/js/portal_composer.js @@ -133,6 +133,8 @@ var PortalComposer = publicWidget.Widget.extend({ }); }); })).then(function () { + // ensures any selection triggers a change, even if the same files are selected again + self.$fileInput[0].value = null; self.$sendButton.prop('disabled', false); }); },