OdooWiki OCA HUB

Mail Preview

mail_preview_base folder_open OCA/social open_in_new
Uncategorised License: LGPL-3

This module has two goals:

  • Define a unique system for inheritance that will allow to introduce more types for the preview.
  • Define a new widget that will allow to show the preview.

auto_awesome What this module does

AI-generated from the code · Odoo 15.0

Adds a preview button to file attachments in Odoo, letting users view images, PDFs, videos and text files directly in a pop-up viewer instead of downloading them.

This module is a technical foundation that makes file previews possible in Odoo. On the attachment form (the screen where a file is stored), the file content field now uses a special preview widget, so a small magnifying-glass icon appears next to the file when it can be previewed.

Clicking that icon opens a viewer window on top of the current screen. The viewer can display: - images - PDF documents - videos - text files

It also extends the attachment viewer used in the Discuss/mail app so that text attachments are recognised as previewable, in addition to images, videos and PDFs. Downloading from the viewer is handled through Odoo's standard file download link.

The module does not add menus, reports, scheduled actions or business rules. It only changes how attachments are displayed: the ir.attachment form view is modified and the mail document viewer behaviour is extended. Other modules can build on this base to add more preview types.

Depends on

mail

Required by other modules

Text generated by AI (DeepSeek) from reading the Odoo 15.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: 4 confirmed, 5 with no information of 9 versions.

terminal Installation and usage

OCA documentation · Odoo 15.0

Creating a new preview file

You need to add the configuration in three places:

* Function `_checkAttachment` and `_hasPreview` from `mail.DocumentViewer` on
  Javascript
* Qweb template `DocumentViewer.Content`

To use this module, you need to:

#. Go to Settings > Technical > Attachments
#. Create attachment with image or pdf format
#. Show preview icon in "File content"

As an example, you can check `mail_preview_audio`.

No verified information in OCA: Installation, 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.