Skip to content

Fork Sync Branch 18.0#9

Merged
btl-bot merged 19 commits into
BTLzdravtech:18.0from
OCA:18.0
Jun 11, 2026
Merged

Fork Sync Branch 18.0#9
btl-bot merged 19 commits into
BTLzdravtech:18.0from
OCA:18.0

Conversation

@btl-bot

@btl-bot btl-bot commented Jun 11, 2026

Copy link
Copy Markdown

No description provided.

simahawk and others added 19 commits June 5, 2026 15:39
Signed-off-by simahawk
Signed-off-by lmignon
Add a "Swap Storage Backend" wizard in `storage_file` to move one or
more `storage.file` records between backends. Triggered via an
`ir.actions.server` bound to `storage.file` list/form views, so it
works on multi-selection from the Action menu.

The wizard is pre-filled with the current selection's backend as
source and refuses any selection spanning multiple backends. The
destination domain excludes the source.

On apply, `storage.file._swap_backend(new_backend)`:
* downloads the binary from the old backend,
* uploads to the new one (recomputing `relative_path` from the
  destination `filename_strategy`),
* updates `backend_id` and `relative_path`,
* schedules deletion of the old physical file via `cr.postcommit`,
  so the original is removed only if the transaction commits. On
  rollback the source file is preserved.

Records already on the destination are skipped.

The wizard exposes a `_resolve_file_ids(active_model, active_ids)`
hook so submodules can map their own records to the underlying
`storage.file` ids. `storage_image` and `storage_media` will register
server actions on their models that reuse the base wizard.
* drop the postcommit part
* make it hookable so that for big batches of files we can rely on queue_job
Allow delegation of big batch of files to queue jobs.

[IMP] storage_file_swap_backend_queue: add flag to turn on/off
In case you change the backend directly from form or not.
Signed-off-by simahawk
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: storage-18.0/storage-18.0-storage_image
Translate-URL: https://translation.odoo-community.org/projects/storage-18-0/storage-18-0-storage_image/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: storage-18.0/storage-18.0-storage_media
Translate-URL: https://translation.odoo-community.org/projects/storage-18-0/storage-18-0-storage_media/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: storage-18.0/storage-18.0-storage_file
Translate-URL: https://translation.odoo-community.org/projects/storage-18-0/storage-18-0-storage_file/

@sireko sireko left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto approved

@btl-bot btl-bot merged commit fbabed7 into BTLzdravtech:18.0 Jun 11, 2026
3 of 4 checks passed
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.

5 participants