Orphaned Attachment Scan
Find the attachments left behind by deleted records and uninstalled modules
Request a live demo · Odoo.sh or On-Premise only, not Odoo Online (SaaS).
Free
App Store price, per Odoo version
19 · 20
Odoo versions, each sold on its own page
Odoo.sh
or On-Premise; not Odoo Online (SaaS)
1.0.8
version of mh_orphan_attachment_scan
An attachment points at a record through res_model and res_id . There is no foreign key behind that pointer - res_id is a Many2oneReference, which Odoo's own source documents as having no FK in the database - so nothing at the database level can stop it going stale.
Deleting a record normally cleans up its attachments. Two paths do not: a child row removed by an ON DELETE CASCADE never runs Python unlink() at all, and uninstalling a module drops its models without touching a single attachment.
And then the file becomes invisible. Odoo refuses read access to an attachment whose record cannot be resolved, so an orphan never appears in any list and is not even returned by a search - the query comes back empty rather than raising. The filestore garbage collector will not help either: it removes files that have no database row, which is the opposite problem.
How it works
Tells you why, not just what
Each result is labelled Record deleted or Model uninstalled . The second kind is the one that can never be recovered by hand, because the model that gave res_id its meaning is gone.
Cautious by design
No cron, no automatic deletion, nothing running in the background. Models whose contents cannot be verified are skipped rather than guessed at - a false positive here would invite you to delete a file that was perfectly fine.
Screenshots


What it does not do
- On a database that has never uninstalled a module and never had records removed by cascade or by hand, this app will correctly find nothing. That is the right answer, and it is worth knowing for certain rather than assuming.
Requirements
- Odoo 19.0 or 20.0. The App Store sells each version separately, so buy the one that matches your database.
- Odoo.sh or On-Premise only. Third-party apps cannot be installed on Odoo Online (SaaS) databases. Check your hosting before buying.
- Module
mh_orphan_attachment_scan, version 19.0.1.0.8, licensed OPL-1.