| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Discuss (mail)
• Sales (sale_management) • Invoicing (account) |
| Lines of code | 331 |
| Technical Name |
cons_attachment_preview |
| License | LGPL-3 |
| Website | https://odoomacedonia.mk |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Discuss (mail)
• Sales (sale_management) • Invoicing (account) |
| Lines of code | 331 |
| Technical Name |
cons_attachment_preview |
| License | LGPL-3 |
| Website | https://odoomacedonia.mk |
📎 Instant Attachment Preview
Transform your Odoo experience with instant file previews. View PDFs, images, videos, Excel spreadsheets, Word documents, and more without ever leaving your workspace.
🎥 Watch It In Action
See how easy it is to preview attachments instantly in Odoo
✨ Key Features
Lightning Fast Previews
Click any attachment thumbnail to instantly view the file in a beautiful, full-screen viewer. No downloads, no waiting, no interruptions to your workflow.
Universal File Support
Preview virtually any file type including images, PDFs, videos, Excel spreadsheets, Word documents, and text files - all seamlessly integrated into Odoo.
Beautiful Interface
Enjoy a modern, intuitive file viewer with zoom controls for images, navigation controls for multiple files, and a clean, distraction-free interface.
Easy Integration
Use the attachment preview widget on any model. Includes built-in support for Partners, Sales Orders, and Order Lines - extend it to your custom models effortlessly.
Built-in Support
Works out of the box with Res Partners, Sales Orders, and Sales Order Lines. No configuration needed - just install and start using immediately.
Multiple File Navigation
When previewing multiple attachments, easily navigate between files using keyboard arrows or click navigation buttons - just like a professional gallery viewer.
📄 Supported File Types
This module provides native preview support for a wide range of file formats:
JPEG, PNG, GIF, SVG, BMP, WebP, TIFF
All PDF files with built-in PDF.js viewer
MP4, WebM, AVI, MOV, MKV, and more
XLSX, XLS, XLSM files with native parsing
DOCX, DOC, DOCM files with formatting preserved
TXT, HTML, CSS, JS, JSON, XML, and more
🛠️ Using the Widget on Custom Models
Want to add instant attachment preview to your own custom models? It's incredibly simple! Just follow these steps:
Step 1: Add the Field
Add a Many2many field to your model pointing to ir.attachment:
from odoo import models, fields
class YourModel(models.Model):
_inherit = 'your.model'
attachment_ids = fields.Many2many(
'ir.attachment',
string='Attachments',
help="Upload attachments for instant preview"
)
Step 2: Add to Your View
In your form view XML, add the field with the many2many_binary widget:
<field name="attachment_ids"
widget="many2many_binary"
options="{'no_create': True}"/>
Step 3: That's It!
The preview functionality is automatically enabled. Users can click any attachment thumbnail to preview files instantly. The widget handles all file types automatically - no additional configuration needed!
💡 Pro Tip
You can place the attachment field anywhere in your form view. A common location is after important fields like partner information or order details. The preview popup works seamlessly regardless of where you place the field.
📸 Screenshots
Attachment Field on Partner Form
See the attachment field integrated into the contact form, allowing instant preview of customer documents.
Sales Order Attachments
Preview order-related documents directly from the sales order form without leaving the page.
Screenshot coming soon
Sales Order form with attachment preview field
Image Preview
Beautiful full-screen image viewer with zoom, rotate, and navigation controls.
Video Preview
Watch videos directly in the browser with native HTML5 video player controls.
PDF Preview
Read PDF documents with the integrated PDF.js viewer - no external applications needed.
📦 Installation
- Download the Module
Download the Instant Attachment Preview module and place it in your Odoo addons directory. - Update Apps List
Navigate toApps→Update Apps Listto refresh your module catalog. - Install
Search for "Instant Attachment Preview" in the Apps menu and clickInstall. - Start Using
The module is ready to use immediately! Visit any Partner, Sales Order, or Order Line form to see the attachment preview field.
🚀 Usage
1. Upload Attachments
Click the attachment button in the "Attachments" field to upload files. You can upload multiple files at once.
2. Click to Preview
Click any attachment thumbnail to open it in the preview viewer. The viewer automatically detects the file type.
3. Navigate & Control
Use arrow keys or navigation buttons to move between files. For images, use zoom controls and rotation. Close with Esc or the X button.
Ready to Enhance Your Odoo Experience?
Install Instant Attachment Preview today and transform how you interact with files in Odoo.
Please log in to comment on this module