Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Property Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
      • Get a Tailored Demo
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +32 2 290 34 90
    • Get a Tailored Demo
  • Pricing
  • Help
  1. APPS
  2. Extra Tools
  3. Preview Attachment : Images, PDFs, Office docs, Excel Reports v 19.0
  4. Sales Conditions FAQ

Preview Attachment : Images, PDFs, Office docs, Excel Reports

by Steven Marp https://apps.odoo.com/apps/browse?repo_maintainer_id=512936
Odoo

$ 71.71

v 19.0 Third Party
Apps purchases are linked to your Odoo account, please sign in or sign up first.
Availability
Odoo Online
Odoo.sh
On Premise
Lines of code 1256
Technical Name sm_preview_attachment
LicenseLGPL-3
Websitehttps://apps.odoo.com/apps/browse?repo_maintainer_id=512936
Versions 17.0 18.0 19.0
You bought this module and need support? Click here!
Availability
Odoo Online
Odoo.sh
On Premise
Lines of code 1256
Technical Name sm_preview_attachment
LicenseLGPL-3
Websitehttps://apps.odoo.com/apps/browse?repo_maintainer_id=512936
Versions 17.0 18.0 19.0

Preview Attachment

Preview Images, PDFs, Office Documents, Excel Reports & More — Directly in Odoo

Watch It In Action

See how Preview Attachment transforms your Odoo experience — no more unnecessary downloads.

Your browser does not support the video tag.

Key Features

Binary Field Preview

One-click Preview button (eye icon) on every Binary field — form view and list view. Works on all widgets including custom ones.

Attachment Preview

Preview button on Many2Many attachment fields. Quick preview without downloading — images, PDFs, documents all viewable inline.

PDF Report Preview

Intercepts PDF report printing — preview the report in a modal before downloading or printing. Works on all QWeb PDF reports.

Excel Preview (SheetJS)

Preview Excel files client-side using SheetJS — rendered as interactive HTML tables. No Office Online or public URL required. Works on localhost!

Office Document Support

Preview Word, Excel, and PowerPoint via Office Online or Google Docs Viewer. Automatic fallback with download option on localhost.

Excel Preview Mixin

Easy-to-use Python mixin for wizard Excel reports. Inherit the mixin, implement 2 methods, and get Preview + Download buttons automatically!

Supported File Formats

Type Extensions Preview Method
Images PNG, JPG, JPEG, GIF, BMP, SVG, WEBP, ICO, TIFF Native <img> tag — fast and reliable
PDF PDF Browser PDF viewer (iframe)
Excel XLS, XLSX, ODS SheetJS client-side rendering (even on localhost!)
Word DOC, DOCX, ODT, RTF Office Online / Google Docs Viewer
PowerPoint PPT, PPTX, ODP Office Online / Google Docs Viewer
Video MP4, WEBM, OGG, MOV, AVI HTML5 video player
Audio MP3, WAV, OGG, FLAC, AAC, M4A HTML5 audio player
Text TXT, CSV, JSON, XML, HTML, CSS, JS, PY, LOG Text viewer (iframe)
Unknown Any file without extension Auto-detect via Content-Type header

How It Works

Install Module

Install the module — no configuration needed. Preview buttons appear automatically on all Binary fields.

Click Preview

Click the eye icon next to any file field or attachment. A preview modal opens instantly.

Print Reports

PDF and Excel reports are intercepted — preview first, then download or print from the modal.

Done!

Close with ESC or click backdrop. Download anytime from the modal header. Zero configuration required.

Excel Preview Mixin for Developers

Build wizard Excel reports with built-in Preview + Download buttons

Python — Inherit the Mixin

class MyWizard(models.TransientModel):
    _name = 'my.wizard'
    _inherit = ['sm.excel.preview.mixin']

    @property
    def _excel_filename(self):
        return 'my_report.xlsx'

    def _generate_excel_data(self):
        output = io.BytesIO()
        # ... generate Excel with openpyxl ...
        return output

XML — Add Buttons

<footer>
    <button name="action_preview_excel"
            type="object"
            string="Preview"
            class="btn-primary"/>
    <button name="action_download_excel"
            type="object"
            string="Download"
            class="btn-secondary"/>
    <button string="Close"
            special="cancel"/>
</footer>

That's it! Just inherit the mixin and implement 2 methods. The mixin handles Preview modal, SheetJS rendering, and file download.

Why This Module?

Zero Configuration

Install and it just works. No settings, no setup. Preview buttons appear automatically on every Binary field and attachment across all models.

Works on All Binary Widgets

Not just standard Binary fields — works on custom widgets too (work_permit_upload, etc.) thanks to smart JS DOM fallback when OWL patches don't apply.

Community & Enterprise

Works on both Odoo Community and Enterprise editions. Only depends on the web module — available in every Odoo installation.

Auto-Detect File Types

Files without extensions? No problem. The module auto-detects file type via Content-Type header and renders the correct preview automatically.

Lightweight & Fast

Pure frontend JavaScript using OWL 2 patches. No heavy backend processing, no extra API calls, no database writes. Zero performance impact.

Excel on Localhost

Unlike other modules that need Office Online (public URL), our Excel preview uses SheetJS client-side rendering — works perfectly on localhost and private servers.

Technical Details

Module Info

  • Version: 18.0.4.0.0
  • License: LGPL-3
  • Dependencies: web (only)
  • Compatibility: Odoo 18.0 CE & EE

Components Patched

  • BinaryField — Preview button on file fields
  • ListBinaryField — Preview in list/tree views
  • Many2ManyBinaryField — Attachment preview
  • Report Handlers — PDF & Excel intercept

Author

Steven Marp

More Apps on Odoo Apps Store

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author or have a question related to your purchase, please use the support page.
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with