| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Lines of code | 609 |
| Technical Name |
ps_doc_compressor |
| License | LGPL-3 |
| Website | https://www.pysquad.com |
| Versions | 17.0 18.0 19.0 |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Lines of code | 609 |
| Technical Name |
ps_doc_compressor |
| License | LGPL-3 |
| Website | https://www.pysquad.com |
| Versions | 17.0 18.0 19.0 |
Document Compressor
Reduce attachment footprint for PDFs and images directly on ir.attachment, with automation you control from General Settings and one-click manual compression when you need it.
Document Compressor automatically compresses large image and PDF files stored as attachments in Odoo to save storage space. A scheduled job can run once per day and only processes binaries that are still marked for compression. You define the minimum size to act on in General Settings (for example, skip everything smaller than 100 KB or a value in MB), turn the cron on or off, and run an immediate batch from settings when you want. Attachments can also be compressed manually from the attachment form or list with no minimum-size rule. Read-only storage insights show total footprint (PostgreSQL size plus binary attachment sizes) and attachment-only size, with a manual refresh to update the numbers after cleanup.
Server requirements:
PDF compression needs the Ghostscript executable gs on the server PATH (install Ghostscript via your OS package manager, not a standalone pip package).
Image compression uses Pillow in the Odoo Python environment (typically already present).
Top Features
Discover the latest features and enhancements.
Image Compression
Optimizes JPEG, PNG, GIF, WebP, BMP, and other raster formats Pillow can decode—JPEG with quality tuning, PNG with optimization, and other types converted to JPEG where appropriate.
PDF Compression
Rewrites PDFs through Ghostscript (gs) for smaller files while keeping documents usable (requires Ghostscript on the server).
Scheduled Compression You Control
Daily cron processes eligible attachments; enable or disable it from General Settings and set a skip threshold in KB or MB so small files are ignored.
Storage Overview
General Settings shows total footprint (database plus binary attachments) and attachment-only size, with a manual refresh after compression or cleanup.
Manual & On-Demand
Compress a single attachment from the form header or list; trigger a full eligible batch anytime with Compress Now in General Settings—no minimum size for manual actions.
Safe Replacement Rule
Attachment bytes are replaced only when the compressed file is smaller; otherwise the original file stays as-is. Failed compressions do not flip attachments to “done” so they can be retried after fixing the environment.
Compression Performance
Average compression ratio based on file type and size.
JPEG images are optimized using quality tuning and usually achieve more than 55% compression.
PNG files are already internally optimized, so compression gains are smaller but still reduce storage usage.
Small PDFs (100 KB or less) are already compact but can still be reduced significantly.
Large PDFs (100 KB+) often achieve very high compression ratios depending on images and embedded content.
Cron Job
Attach File
File size before compression
File size after compression
General Settings — database & attachment size
Under Settings → General Settings → Document Compressor, view Total Database Size (PostgreSQL + binary attachments) and Attachment Size. Use Manual Refresh after compression to see updated footprint; use Compress Now to run a batch immediately.
For Support
NeedHelp?
Got questions or need help? Get in touch.
Contact Us
Email: solutions@pysquad.com
Phone:+91
8160395422
WhatsApp: +91 8160395422
Discover more at
www.odoo.pysquad.com
Please log in to comment on this module