-
-
Notifications
You must be signed in to change notification settings - Fork 224
[18.0][IMP] storage_backend: add storage category + limit swap by category #633
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
b0aafb3
[IMP] storage_backend: add storage category
simahawk d32e218
[IMP] storage_file: limit swap to selected backends
simahawk bbde178
[IMP] storage_image: form select only same category backend
simahawk 7e3ca26
[IMP] storage_media: form select only same category backend
simahawk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| from . import storage_backend | ||
| from . import storage_backend_category |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # Copyright 2026 Camptocamp SA | ||
| # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | ||
|
|
||
| from odoo import fields, models | ||
|
|
||
|
|
||
| class StorageBackendCategory(models.Model): | ||
| _name = "storage.backend.category" | ||
| _description = "Storage Backend Category" | ||
| _order = "name" | ||
|
|
||
| name = fields.Char(required=True, index=True) | ||
| description = fields.Text() | ||
| backend_ids = fields.One2many("storage.backend", "categ_id", string="Backends") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | ||
| access_storage_backend_edit,storage_backend edit,model_storage_backend,base.group_system,1,1,1,1 | ||
| access_storage_backend_category_edit,storage_backend_category edit,model_storage_backend_category,base.group_system,1,1,1,1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| <?xml version="1.0" encoding="UTF-8" ?> | ||
| <odoo> | ||
| <record id="storage_backend_category_view_tree" model="ir.ui.view"> | ||
| <field name="model">storage.backend.category</field> | ||
| <field name="arch" type="xml"> | ||
| <list> | ||
| <field name="name" /> | ||
| </list> | ||
| </field> | ||
| </record> | ||
|
|
||
| <record id="storage_backend_category_view_form" model="ir.ui.view"> | ||
| <field name="model">storage.backend.category</field> | ||
| <field name="arch" type="xml"> | ||
| <form string="Storage Backend Category"> | ||
| <group> | ||
| <field name="name" /> | ||
| <field name="description" /> | ||
| </group> | ||
| <group name="backends" string="Backends"> | ||
| <field name="backend_ids" readonly="True"> | ||
| <list> | ||
| <field name="name" /> | ||
| </list> | ||
| </field> | ||
| </group> | ||
| </form> | ||
| </field> | ||
| </record> | ||
|
|
||
| <record id="storage_backend_category_view_search" model="ir.ui.view"> | ||
| <field name="model">storage.backend.category</field> | ||
| <field name="arch" type="xml"> | ||
| <search string="Storage Backend Category"> | ||
| <field name="name" /> | ||
| </search> | ||
| </field> | ||
| </record> | ||
|
|
||
| <record model="ir.actions.act_window" id="act_open_storage_backend_category_view"> | ||
| <field name="name">Storage Backend Category</field> | ||
| <field name="type">ir.actions.act_window</field> | ||
| <field name="res_model">storage.backend.category</field> | ||
| <field name="view_mode">list,form</field> | ||
| <field name="search_view_id" ref="storage_backend_category_view_search" /> | ||
| </record> | ||
|
|
||
| <menuitem | ||
| id="menu_storage_backend_category" | ||
| parent="menu_storage" | ||
| sequence="5" | ||
| action="act_open_storage_backend_category_view" | ||
| /> | ||
| </odoo> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.