From f79f2be85ca4ca16ed768568e431c2ef21b72715 Mon Sep 17 00:00:00 2001 From: Aditya Sharma Date: Fri, 19 May 2023 06:04:13 +0000 Subject: [PATCH] [FIX] mail: preview of some documents were broken How to reproduce the bug ======================== -> Try to preview some documents like (Employement Contract.pdf or Odoo CLA.pdf). -> Preview is broken. Technical ========= "application/pdf;base64" mimetype was not included in the isPdf() so the method was returning the false value. After this commit: ================== Now the PDF containing this mimetype are previewable. Task-3305415 closes odoo/odoo#124412 X-original-commit: 698d51fa56be47eb108cec299b12a3f6b58058b9 Signed-off-by: Thibault Delavallee (tde) --- addons/mail/static/src/core/common/attachment_model.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail/static/src/core/common/attachment_model.js b/addons/mail/static/src/core/common/attachment_model.js index 159a7c30419..66cf0af33fd 100644 --- a/addons/mail/static/src/core/common/attachment_model.js +++ b/addons/mail/static/src/core/common/attachment_model.js @@ -53,7 +53,7 @@ export class Attachment { } get isPdf() { - return this.mimetype === "application/pdf"; + return this.mimetype && this.mimetype.startsWith("application/pdf"); } get isImage() {