From da9b89ad2697df7492e3f41c35f46c0b29afaef5 Mon Sep 17 00:00:00 2001
From: MerlinGuillaume <megu@odoo.com>
Date: Tue, 2 May 2023 14:25:25 +0000
Subject: [PATCH] [FIX] mail: disable the sidebar when opening a pdf in the
 chatter
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The pdf viewer sometimes displays the sidebar when we open the pdf

Solution:
Add `pagemode=none` to the url when opening a pdf in attachments

opw-3193516

closes odoo/odoo#120330

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
---
 addons/mail/static/src/models/attachment/attachment.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/addons/mail/static/src/models/attachment/attachment.js b/addons/mail/static/src/models/attachment/attachment.js
index da913a77d955..70269ce73e06 100644
--- a/addons/mail/static/src/models/attachment/attachment.js
+++ b/addons/mail/static/src/models/attachment/attachment.js
@@ -172,7 +172,7 @@ function factory(dependencies) {
                 return `/web/image/${this.id}?unique=1&amp;signature=${this.checksum}&amp;model=ir.attachment`;
             }
             if (this.fileType === 'application/pdf') {
-                return `/web/static/lib/pdfjs/web/viewer.html?file=/web/content/${this.id}?model%3Dir.attachment`;
+                return `/web/static/lib/pdfjs/web/viewer.html?file=/web/content/${this.id}?model%3Dir.attachment#pagemode=none`;
             }
             if (this.fileType && this.fileType.includes('text')) {
                 return `/web/content/${this.id}?model%3Dir.attachment`;
-- 
GitLab