Fs Folder
fs_folder · OCA/storage
Health
88/100
good
-
Security25/25No findings
-
Activity25/25Last human commit 2 months ago
-
Required by20/253 modules depend on it
-
Maturity18/25In 3 Odoo series since 18.0
Heuristic over the facts below, not an audit · How it's computed
Required by
3
Modules depending on it
External deps
1 pip · 0 bin
Python packages / system binaries
License
LGPL-3
No conflicts with its dependencies
Folder size
0.19 MB
Module directory on disk
Code analysis
0 migration notes
5 models
1 view
11 HTTP endpoints
Description
If you need to link some specific models to a specific folder into an external filesystem and be able to manage the content of this folder from the model form view, this module is for you.
Dependencies
- Odoo dependencies
- Python dependencies
- fsspec>=2024.5.0
- System dependencies
- None
- Required by
- fs_folder_demo, fs_folder_ms_drive, fs_folder_webdav
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
Views touched 1
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
fs_storage_form_view |
fs.storage | form | Inherits fs_storage.fs_storage_form_view |
HTTP endpoints 11
| Route(s) | Handler | Auth | Type | Methods | Flags |
|---|---|---|---|---|---|
/fs_folder/add_folder/<string:res_model>/<int:res_id>/<string:field_name> |
FsFolderController.add_folder |
user | json | POST | |
/fs_folder/copy/<string:res_model>/<int:res_id>/<string:field_name> |
FsFolderController.copy_file |
user | json | POST | |
/fs_folder/delete/<string:res_model>/<int:res_id>/<string:field_name> |
FsFolderController.delete |
user | json | POST | |
/fs_folder/delete_folder/<string:res_model>/<int:res_id>/<string:field_name> |
FsFolderController.delete_folder |
user | json | POST | |
/fs_folder/get_children/<string:res_model>/<int:res_id>/<string:field_name> |
FsFolderController.get_children |
user | json | POST | |
/fs_folder/get_file/<string:res_model>/<int:res_id>/<string:field_name> |
FsFolderController.get_file |
user | http | GET | |
/fs_folder/initialize/<string:res_model>/<int:res_id>/<string:field_name> |
FsFolderController.initialize |
user | json | POST | |
/fs_folder/move/<string:res_model>/<int:res_id>/<string:field_name> |
FsFolderController.move_file |
user | json | POST | |
/fs_folder/rename/<string:res_model>/<int:res_id>/<string:field_name> |
FsFolderController.rename |
user | json | POST | |
/fs_folder/unlink_folder/<string:res_model>/<int:res_id>/<string:field_name> |
FsFolderController.unlink_folder |
user | json | POST | |
/fs_folder/upload/<string:res_model>/<int:res_id>/<string:field_name> |
FsFolderController.upload |
user | json | POST |
Models touched 5
New fields (0)
No new fields.
Public methods (0)No public methods.
New fields (0)
No new fields.
Public methods (0)No public methods.
New fields (0)
No new fields.
Public methods (12)-
copy_item(self, res_id, res_model, field_name, path, new_path, recursive=False, **kwargs) -> None@api.modelCopy the fs item :param res_id: the id of the record containing the field :param res_model: the model of the record containing the field :param field_name: the name of the field :param path: the path of the item :param new_path: the new path of the item -
create_folder(self, res_id, res_model, field_name, path, **kwargs) -> None@api.modelCreate a folder at the given path. :param res_id: the id of the record containing the field :param res_model: the model of the record containing the field :param field_name: the name of the field :param path: the path of the folder to create -
delete(self, res_id, res_model, field_name, path, recursive=False, **kwargs) -> None@api.modelDelete the given item. :param res_id: the id of the record containing the field :param res_model: the model of the record containing the field :param field_name: the name of the field :param path: the path of the item -
get_children(self, res_id, res_model, field_name, path, **kwargs) -> <expr>@api.modelReturn the children of the given item. :param res_id: the id of the record containing the field :param res_model: the model of the record containing the field :param field_name: the name of the field :param path: the path of the item :return: a list of children items -
get_root(self, res_id, res_model, field_name, **kwargs) -> dict@api.modelReturn the root of the filesystem. :param res_id: the id of the record containing the field :param res_model: the model of the record containing the field :param field_name: the name of the field :return: the root of the filesystem -
get_url_for_download(self, res_id, res_model, field_name, path, **kwargs) -> str@api.modelReturn the preview url of the given item. :param res_id: the id of the record containing the field :param res_model: the model of the record containing the field :param field_name: the name of the field :param path: the path of the item :return: the preview url -
get_url_for_preview(self, res_id, res_model, field_name, path, **kwargs) -> str@api.modelReturn the preview url of the given item. :param res_id: the id of the record containing the field :param res_model: the model of the record containing the field :param field_name: the name of the field :param path: the path of the item :return: the preview url -
initialize_field_value(self, res_id, res_model, field_name, **kwargs) -> None@api.modelInitialize the value of the field. -
remove_field_value(self, res_id, res_model, field_name, **kwargs) -> None@api.modelDelete the value of the field. -
rename(self, res_id, res_model, field_name, path, new_path, **kwargs) -> None@api.modelRename the given item. :param res_id: the id of the record containing the field :param res_model: the model of the record containing the field :param field_name: the name of the field :param name: the name of the item to rename :return: the new reference -
update_content(self, res_id, res_model, field_name, path, file_data, **kwargs) -> None@api.modelUpdate the content of the given item. :param res_id: the id of the record containing the field :param res_model: the model of the record containing the field :param field_name: the name of the field :param path: the path of the item :param new_content: the new content of the item (b64 encoded) -
upload_file(self, res_id, res_model, field_name, path, file_name, file_data, mimetype=None, **kwargs) -> None@api.modelUpload a file to the given item. :param res_id: the id of the record containing the field :param res_model: the model of the record containing the field :param field_name: the name of the field :param parent_path: the path of the parent item :param name: the name of the file :param content: the content of the file (b64 encoded) :param mimetype: the mimetype of the file :return: the reference of the uploaded file
New fields (3)
-
fs_name_sanitization_replace_charChardefault='_'help='The character used to replace the invalid characters in the names of the filesystem items created by the fields.' -
sanitize_fs_nameBooleandefault=Truehelp="If checked, the names of the filesystem items created by the fields will be sanitized. Invalid characters will be replaced by the value provided by the field 'fs_name_sanitizatio_replace_char'." -
use_as_default_for_fs_contentsBooleandefault=Falsehelp='If checked, this storage will be used to store the content of the external filesystem fields by default. '
-
get_default_storage_code_for_fs_content(self, model_name, field_name) -> str@api.modelReturn the code of the default storage for the content of the external filesystem fields. -
get_storage_code_for_fs_content_fallback(self) -> <expr>@api.model@tools.ormcache() -
is_fs_name_valid(self, name, raise_if_invalid=False) -> bool -
is_fs_names_valid(self, names, raise_if_invalid=False) -> bool -
sanitize_fs_item_name(self, name, replace_char=None) -> strSanitize a filesystem item name by replacing invalid characters with a replacement character. :param name: the name to sanitize :param replace_char: the character to use as replacement. If not provided, the value of the field 'fs_name_sanitization_replace_char' will be used. :return: the sanitized name -
sanitize_fs_item_names(self, names, replace_char=None) -> <expr>Sanitize a list of filesystem item names by replacing invalid characters with a replacement character. :param names: the names to sanitize :param replace_char: the character to use as replacement. If not provided, the value of the field 'fs_name_sanitization_replace_char' will be used. :return: the sanitized names
New fields (1)
-
ttypeSelectionondelete={'fs_folder': 'cascade'}selection_add=[('fs_folder', 'External Folder')]
No public methods.
Loading…
Loading…