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. Productivity
  3. Find Orphaned Attachments v 19.0
  4. Sales Conditions FAQ

Find Orphaned Attachments

by Farhan Ashraf https://apps.odoo.com/apps/modules/browse?author=Farhan+Ashraf
Odoo
v 19.0 Third Party 6
Download for v 19.0 Deploy on Odoo.sh
Apps purchases are linked to your Odoo account, please sign in or sign up first.
Versions 14.0 15.0 16.0 17.0 18.0 19.0
You bought this module and need support? Click here!
Versions 14.0 15.0 16.0 17.0 18.0 19.0
  • Description
  • Manifest

Find Orphaned Attachments

Reclaim the filestore space deleted records left behind.

Deleting a record does not always remove the files attached to it. After data imports, module uninstalls and failed jobs, attachments are left pointing at a record that is gone — or at a model that no longer exists in the database at all. Nothing ever cleans them up, and they keep consuming filestore space forever. This module scans for them, groups them by model, and shows exactly how much space they waste. Free and open source (LGPL-3), Odoo 14.0 through 19.0.

  • Report only — the scan never changes anything. Opening it is always safe.
  • Two kinds of orphan — attachments whose model is no longer in the registry (an uninstalled module, a removed model) and attachments whose record was deleted.
  • Reclaimable space — per model and in total, so you know what a cleanup is worth before running it.
  • Deliberate cleanup — a confirmation box plus a confirmation dialog, reserved for Settings administrators, deleting exactly what was listed and nothing else.
  • Pick and choose — untick any model group you would rather keep.
  • Fast on large databases — one grouped query lists the models, one existence check per model finds the dead records. Attachments are never read one by one.

Screenshots

01-scan-results

The scan groups orphaned attachments by model, states why each group is orphaned and how much space it would give back. Nothing is deleted until you say so.

02-clean-scan

After the cleanup — and on a healthy database — the scan simply reports that there is nothing to do, and how many attachments it inspected.

Installation

  1. Open Apps, search for Find Orphaned Attachments and click Install.
  2. Only the standard base module is required — no dependency on any app.

Configuration

  1. Nothing to configure. The entry appears under Settings → Orphaned Attachments for users with Administration / Access Rights.
  2. The delete button and its confirmation box are shown only to Administration / Settings users; everybody else sees the report alone.
  3. Back up your filestore before the first cleanup, as you would before any bulk deletion.

Usage

  1. Go to Settings → Orphaned Attachments. The scan runs immediately and only reads.
  2. Read the lines: one per model, with the reason (Model no longer exists or Record no longer exists), the number of files and the reclaimable space.
  3. Untick Delete on any group you want to keep.
  4. Tick Yes, permanently delete the selected files, click Delete Selected Attachments and confirm the dialog.
  5. Click Rescan whenever you want fresh figures.

Safety — what is never touched

A wrong deletion here destroys data, so the scan is deliberately conservative. These attachments are never listed and never deleted:

  • Files with no model at all — documents users uploaded on their own, which belong to nobody but them.
  • Web assets and module data — ir.ui.view, ir.asset, ir.actions.report and ir.module.module, which Odoo owns and regenerates by itself.
  • Binary field storage — any attachment with res_field set holds the value of a field on a live record; deleting it would blank that field.
  • Uploads in progress — attachments not linked to a record yet.
  • Archived or invisible records — existence is checked directly against the table, ignoring record rules and the active flag, so a record that is merely hidden from you is never mistaken for a deleted one.

The cleanup re-applies every one of these exclusions to the selected lines immediately before deleting, so nothing outside the reported set can be removed.

Version notes

Identical behavior on every supported series (14.0 – 19.0).

Questions, bugs or feature requests?
Email f.ashraf.dev1@gmail.com — I read and answer every message.

License: LGPL-3 · Source on GitHub · Issues and contributions welcome.

Availability
Odoo Online
Odoo.sh
On Premise
Lines of code 275
Technical Name orphan_attachment_cleaner
LicenseLGPL-3
Websitehttps://apps.odoo.com/apps/modules/browse?author=Farhan+Ashraf

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, please use the developer contact information. They can usually be found in the description.
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