fs_attachment
Enable Odoo to store and serve attachments from external filesystem or object storages managed via fs.storage while preserving meaningful filenames and efficient streaming.
Key Features
- ir.attachment: Stores attachments on any fsspec-compatible filesystem configured in fs.storage, automatically selecting the backend per record and falling back to the filestore when none is set.
- ir.attachment: Adds filesystem-aware metadata fields such as fs_filename, internal URL, filesystem URL, and storage references so users and integrations can retrieve documents directly from the chosen storage.
- ir.attachment: Enforces slugified versioned filenames that preserve extensions when writing to external storage, ensuring human-readable and SEO-friendly URLs.
- ir.attachment: Provides a file-like open() adapter and end-to-end streaming so code can read or update attachment content without loading entire files into memory.
- ir.attachment: Applies per-mimetype size rules to keep small images or assets in the database for speed and exposes admin helpers to move attachments between database and external storage.
- ir.attachment: Integrates with a garbage collection workflow that marks stored filenames and automatically removes orphaned files when records are deleted or transactions fail.
- fs.storage: Adds attachment-specific options for default storage designation, directory fan-out, filename obfuscation, base URL computation, X-Sendfile serving, and autovacuum behavior.
- fs.storage: Lets administrators define mimetype/size policies for keeping certain attachments in the database and trigger URL recomputation whenever base paths or directory settings change.
- fs.file.gc: Maintains a dedicated garbage collection queue per storage code and purges unreferenced files in safe autovacuum-compatible batches.
- ir.binary: Extends binary field streaming so HTTP endpoints can serve filesystem-backed attachments directly, including image resizing and explicit download names.
- streaming: Supplies FsStream responses that either stream bytes end-to-end or delegate delivery to the reverse proxy via X-Sendfile headers to reduce load on Odoo.