| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Lines of code | 836 |
| 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 works best with the Ghostscript executable gs on the server PATH. If Ghostscript is not found (common on Odoo.sh), the system uses an automatic Python-native fallback (pypdf).
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 maximum compression,
with an automatic Python-native fallback (pypdf) for Odoo.sh
compatibility.
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.
Model & Date Range Based Compression
Compress documents for a selected model within a specific date range, giving you precise control over which records are processed.
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.
General Settings — database & attachment size
Under Settings → General Settings → Document Compressor, view Total Database Size (PostgreSQL + binary attachments) and Attachment Size. Use Update Metrics (Manual Refresh) after compression to see the updated footprint; use Compress Now to run a batch immediately. Configure compression per model with an optional date range. If no model-specific range is set, the global date range from General Settings is used.
Model Specific Configurations
Define custom date ranges for specific Odoo models (e.g., Sale Orders, Invoices). The system uses the model-specific date range if provided; otherwise, it falls back to the Global Date Filter. If neither is set, all documents for that model are eligible for compression.
Enable Automatic Compression Cron
Automate your document optimization with a daily scheduled job. When enabled, the system automatically identifies and compresses eligible attachments based on your size and date filters, ensuring storage efficiency without manual intervention.
Attach File
File size before compression
File size after compression
Verify the reduced file size after the compression process. Note: In this configuration, only Sale Order attachments defined in Model-Specific Configuration are processed.
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