Skip to content

[18.0][IMP] storage_backend: add storage category + limit swap by category#633

Open
simahawk wants to merge 5 commits into
OCA:18.0from
camptocamp:18-backend-category
Open

[18.0][IMP] storage_backend: add storage category + limit swap by category#633
simahawk wants to merge 5 commits into
OCA:18.0from
camptocamp:18-backend-category

Conversation

@simahawk

Copy link
Copy Markdown
Contributor

A way to classify storages in a functional way.
For instance: you might have N storage backends for the shop,
N storage backends for data import, N storage backends for EDI purposes.

With this change you can finally organize them
and let your customers understand what such storages do.

On top of that, swapping files is now limited by category.

@OCA-git-bot OCA-git-bot added series:18.0 mod:storage_file Module storage_file mod:storage_backend Module storage_backend labels Jun 11, 2026
@simahawk simahawk changed the title [IMP] storage_backend: add storage category + limit swap by category [18.0][IMP] storage_backend: add storage category + limit swap by category Jun 11, 2026
@simahawk simahawk force-pushed the 18-backend-category branch 2 times, most recently from c2b7bfb to 0a2e3f7 Compare June 11, 2026 12:47
simahawk added 5 commits June 12, 2026 09:22
A way to classify storages in a functional way.
For instance: you might have N storage backends for the shop,
N storage backends for data import, N storage backends for EDI purposes.

With this change you can finally organize them
and let your customers understand what such storages do.
Is not allowed to swap files to a backend of a different category.
A technical door is left opened in case for specific reasons you want force file swap
by using the ctx key swap_backend_bypass_category_check.
@simahawk simahawk force-pushed the 18-backend-category branch from 0a2e3f7 to 0cb1fd2 Compare June 12, 2026 07:22
@OCA-git-bot OCA-git-bot added mod:storage_media Module storage_media mod:storage_image Module storage_image labels Jun 12, 2026
@rrebollo

Copy link
Copy Markdown

Is this work ready for review? I would suggest renaming the PR to indicate that the changes affect several addons. Also, the commit history could benefit from some squashing.

@rrebollo rrebollo 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.

Pretty solid development. I would suggest mentioning the feature in some of the addon's documentation. Also, please address the commit organization issues. Once that's done, feel free to ping me and I'll approve.

Also, please consider reviewing my contribution (#634) in return.

"storage.backend.category",
related="source_backend_id.categ_id",
string="Source Backend Category",
readonly=True,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
readonly=True,

It's default for related fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:storage_backend Module storage_backend mod:storage_file Module storage_file mod:storage_image Module storage_image mod:storage_media Module storage_media series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants