OdooWiki OCA HUB

Preview attachments

attachment_preview folder_open OCA/knowledge open_in_new
Knowledge Management License: AGPL-3

This addon allows to preview attachments supported by .

Currently, that's most Libreoffice files and PDFs.

auto_awesome What this module does

AI-generated from the code · Odoo 18.0

Preview PDF and LibreOffice attachments directly inside Odoo without downloading them. A preview button appears on attachments and binary fields, opening a side panel or a new tab.

This module adds an in-app preview for attachments that Viewer.js can display, mainly PDFs and LibreOffice documents (odt, odp, ods, fodt, ott, fodp, otp, fods, ots).

Where it appears: - On attachment cards in the chatter and other mail attachment lists, a preview button (magnifier) opens the file in a side panel, and a second button (external-link) opens it in a new tab. - On binary fields in forms, a preview button is added next to the download button when the file type is supported. - The side panel shows the document in an iframe with previous/next navigation, a page counter, a pop-out button and a close button.

Business rules and automatic behaviour: - The module determines the file extension of an attachment or binary field, first from the file name, then by inspecting the file content, so previews work even when the name lacks an extension. - Only supported extensions get a preview button; unsupported files show an alert if preview is attempted. - The preview panel closes automatically when you navigate to a different record.

It touches ir.attachment and the mail attachment list, and patches form and binary field rendering in the web client.

Depends on

webmail
Models and fields (1)
  • ir.attachment · extends an existing model

Text generated by AI (DeepSeek) from reading the Odoo 18.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub

Availability by version

Reviewed: 2026-11-03
Confirmed (verified in repository and branch) Estimated (unverified) No information

Confirmation status: 5 confirmed, 4 with no information of 9 versions.

Sources · Odoo 18.0

Confirmed on 2026-11-03 in branch 18.0 of OCA/knowledge.

terminal Installation and usage

OCA documentation · Odoo 18.0

For filetype recognition, you'll get the best results by installing python-magic:

sudo apt-get install python-magic

The module adds a little print preview icon right of download links for attachments or binary fields. When a preview is opened from the attachments menu it's shown next to the form view. From this screen you can navigate through the attachments using the arrow buttons. Using the pop-out button next to the navigational buttons you can open the preview in a separate window.

No verified information in OCA: Configuration.

info

Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.