TIP: You can type at any time to perform a new search.
Storage File
storage_file · OCA/storage
- Repository
- OCA/storage · module folder · Try on Runboat
- Module version
- 1.0.0
- Category
- Storage
- Folder size
- 0.09 MB
- License
- LGPL-3
- Application
- No
- Auto-installable
- No
- Website
- https://github.com/OCA/storage
- Last tracking update
- 2026-08-07 09:06:25
- Authors
- Akretion, Odoo Community Association (OCA)
- Maintainers
- Akretion, Odoo Community Association (OCA)
- Committers
- Stéphane Bidoul, Laurent Mignon (ACSONE)
- Odoo dependencies
- Python dependencies
- python_slugify, cachetools
- System dependencies
- None
- Required by
- storage_media, storage_thumbnail
- Description
External file management depending on Storage Backend module. It include these features: \* link to any Odoo model/record \* store metadata like: checksum, mimetype Use cases (with help of additional modules): - store pdf (like invoices) on a file server with high SLA - access attachments with read/write on prod environment and only read only on dev / testing
Code Analysis ⓘ
Views touched (4)
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
storage_backend_view_form |
storage.backend | form | Inherits storage_backend.storage_backend_view_form | |
storage_file_view_form |
storage.file | form | New | |
storage_file_view_search |
storage.file | search | New | |
storage_file_view_tree |
storage.file | list | New |
HTTP endpoints (1)
| Route(s) | Handler | Auth | Type | Methods | Flags |
|---|---|---|---|---|---|
/storage.file/<string:slug_name_with_id> |
StorageFileController.content_common |
public | http | ALL |
Models touched (4)
New fields (0)
No new fields.
Public methods (1)-
render_qweb_pdf(self, res_ids=None, data=None)
New fields (7)
-
backend_view_use_internal_urlBooleanhelp='Decide if Odoo backend views should use the external URL (usually a CDN) or the internal url with direct access to the storage. This could save you some money if you pay by CDN traffic.' -
base_urlChardefault='' -
base_url_for_filesCharcompute='_compute_base_url_for_files'store=True -
filename_strategySelectiondefault='name_with_id'help='Strategy to build the name of the file to be stored.\nName and ID: will store the file with its name + its id.\nSHA Hash: will use the hash of the file as filename (same method as the native attachment storage)'selection=[('name_with_id', 'Name and ID'), ('hash', 'SHA hash')] -
is_publicBooleandefault=Falsehelp='Define if every files stored into this backend are public or not. Examples:\nPrivate: your file/image can not be displayed is the user is not logged (not available on other website);\nPublic: your file/image can be displayed if nobody is logged (useful to display files on external websites)' -
served_bySelectiondefault='odoo'required=Trueselection=[('odoo', 'Odoo'), ('external', 'External')] -
url_include_directory_pathBooleandefault=Falsehelp="Normally the directory_path it's for internal usage. If this flag is enabled the path will be used to compute the public URL."
-
action_recompute_base_url_for_files(self)Refresh base URL for files. Rationale: all the params for computing this URL might come from server env. When this is the case, the URL - being stored - might be out of date. This is because changes to server env fields are not detected at startup. Hence, let's offer an easy way to promptly force this manually when needed. -
write(self, vals)
New fields (18)
-
activeBooleandefault=True -
backend_idMany2one → storage.backendindex=Truerequired=True args: 'storage.backend', 'Storage' -
checksumCharindex=Truesize=40 args: 'Checksum/SHA1' -
company_idMany2one → res.companydefault=<expr> args: 'res.company', 'Company' -
dataBinarycompute='_compute_data'copy=Truehelp='Data'inverse='_inverse_data'store=False -
extensionCharcompute='_compute_extract_filename'store=True -
file_sizeInteger -
file_typeSelectionargs: [] -
filenameCharcompute='_compute_extract_filename'store=True args: 'Filename without extension' -
human_file_sizeCharcompute='_compute_human_file_size'store=True -
internal_urlCharcompute='_compute_internal_url'help='HTTP URL to load the file directly from storage.' -
mimetypeCharcompute='_compute_extract_filename'store=True args: 'Mime Type' -
nameCharindex=Truerequired=True -
relative_pathCharcopy=Falsehelp='Relative location for backend' -
slugCharcompute='_compute_slug'help='Slug-ified name with ID for URL'store=True -
to_deleteBoolean -
urlCharcompute='_compute_url'help='HTTP accessible path to the file' -
url_pathCharcompute='_compute_url_path'help='Accessible path, no base URL'
-
get_from_slug_name_with_id(self, slug_name_with_id)@api.modelReturn a browse record from a string generated by the method _slugify_name_with_id :param slug_name_with_id: :return: a BrowseRecord (could be empty...) -
unlink(self) -
write(self, vals)
New fields (3)
-
dataBinary -
file_idMany2one → storage.fileargs: 'storage.file' -
file_nameChar
-
confirm(self)
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…