From 09b3e8cfa1874caeeecced015c7fb5614043b8a2 Mon Sep 17 00:00:00 2001 From: "Didier (did)" Date: Fri, 24 Dec 2021 10:08:36 +0000 Subject: [PATCH] [FIX] mail: temporary id should be negative MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this commit temporary id could match an existing attachment id and replace that attachment by the new uploaded one. Even if this is very unlikly, using a negative id avoid it completly. closes odoo/odoo#82185 X-original-commit: c18705d1ced6a9b1d6bb8c33049a1248ae83cf18 Signed-off-by: Alexandre Kühn (aku) --- .../mail/static/src/components/file_uploader/file_uploader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail/static/src/components/file_uploader/file_uploader.js b/addons/mail/static/src/components/file_uploader/file_uploader.js index 3ab2f1e2a9c..1f4de9c67aa 100644 --- a/addons/mail/static/src/components/file_uploader/file_uploader.js +++ b/addons/mail/static/src/components/file_uploader/file_uploader.js @@ -12,7 +12,7 @@ const { useRef } = owl.hooks; const geAttachmentNextTemporaryId = (function () { let tmpId = 0; return () => { - tmpId += 1; + tmpId -= 1; return tmpId; }; })();