Skip to content

[FIX] fs_attachment: ignore missing files when migrating to object storage#555

Open
ivantodorovich wants to merge 1 commit intoOCA:19.0from
camptocamp:19.0-fix-fs-attachment-force-ignore-missing
Open

[FIX] fs_attachment: ignore missing files when migrating to object storage#555
ivantodorovich wants to merge 1 commit intoOCA:19.0from
camptocamp:19.0-fix-fs-attachment-force-ignore-missing

Conversation

@ivantodorovich
Copy link
Contributor

@ivantodorovich ivantodorovich commented Feb 12, 2026

In the event an attachment's file is not present in the filestore, Odoo would log an error and return an empty file content: b'' upon reading it's datas.

During a migration to the object storage, that would cause an empty file to be uploaded to the object storage, and the original attachment's checksum to be overwritten with the checksum of the empty file.

This commit fixes this by checking if the file exists before attempting to migrate it, ignoring it otherwise.

@OCA-git-bot
Copy link
Contributor

Hi @lmignon,
some modules you are maintaining are being modified, check this out!

@ivantodorovich ivantodorovich force-pushed the 19.0-fix-fs-attachment-force-ignore-missing branch 2 times, most recently from e6074ca to a28157f Compare February 12, 2026 12:25
…orage

In the event an attachment's file is not present in the filestore, Odoo would
log an error and return an empty file content: b'' upon reading it's `datas`.

During a migration to the object storage, that would cause an empty file to be
uploaded to the object storage, and the original attachment's checksum to be
overwritten with the checksum of the empty file.

This commit fixes this by checking if the file exists before attempting to
migrate it, ignoring it otherwise.
@ivantodorovich ivantodorovich force-pushed the 19.0-fix-fs-attachment-force-ignore-missing branch from a28157f to cfbf6dc Compare February 12, 2026 12:42
@ivantodorovich ivantodorovich marked this pull request as ready for review February 12, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants