[ADD] finalize_db: run `_gc_file_store_unsafe` after attachment cleanup

Add ``lib/python/file_gc.py``, a minimal Odoo-shell script that calls
``ir.attachment._gc_file_store_unsafe()`` to remove filestore files
no longer referenced by any ``ir_attachment`` record.

Invoke it in ``finalize_db.sh`` after the SQL attachment purges so
that the deleted CSS/JS asset bundles, resized partner thumbnails,
and orphaned ``ir_attachment`` rows also have their backing files
cleaned from disk.
This commit is contained in:
Stéphan Sainléger
2026-08-10 17:07:08 +02:00
parent b6fd05104a
commit 134b935fa4
2 changed files with 9 additions and 0 deletions

1
lib/python/file_gc.py Normal file
View File

@@ -0,0 +1 @@
env['ir.attachment']._gc_file_store_unsafe()