OdooWiki OCA HUB

Filesystem Storage Backend

fs_storage folder_open OCA/storage open_in_new
FS Storage License: LGPL-3

This addon is a technical addon that allows you to define filesystem like storage for your data. It's used by other addons to store their data in a transparent way into different kind of storages.

Through the fs.storage record, you get access to an object that implements the fsspec.spec.AbstractFileSystem interface and therefore give you an unified interface to access your data whatever the storage protocol you decide to use.

The list of supported protocols depends on the installed fsspec implementations. By default, the addon will install the following protocols:

  • LocalFileSystem
  • MemoryFileSystem
  • ZipFileSystem
  • TarFileSystem
  • FTPFileSystem
  • CachingFileSystem
  • WholeFileSystem
  • SimplCacheFileSystem
  • ReferenceFileSystem
  • GenericFileSystem
  • DirFileSystem
  • DatabricksFileSystem
  • GitHubFileSystem
  • JupiterFileSystem
  • OdooFileSystem

The OdooFileSystem is the one that allows you to store your data into a directory mounted into your Odoo's storage directory. This is the default FS Storage when creating a new fs.storage record.

Others protocols are available through the installation of additional python packages:

  • DropboxDriveFileSystem -\> pip install fsspec[dropbox]
  • HTTPFileSystem -\> pip install fsspec[http]
  • HTTPSFileSystem -\> pip install fsspec[http]
  • GCSFileSystem -\> pip install fsspec[gcs]
  • GSFileSystem -\> pip install fsspec[gs]
  • GoogleDriveFileSystem -\> pip install gdrivefs
  • SFTPFileSystem -\> pip install fsspec[sftp]
  • HaddoopFileSystem -\> pip install fsspec[hdfs]
  • S3FileSystem -\> pip install fsspec[s3]
  • WandbFS -\> pip install wandbfs
  • OCIFileSystem -\> pip install fsspec[oci]
  • AsyncLocalFileSystem -\> pip install 'morefs[asynclocalfs]
  • AzureDatalakeFileSystem -\> pip install fsspec[adl]
  • AzureBlobFileSystem -\> pip install fsspec[abfs]
  • DaskWorkerFileSystem -\> pip install fsspec[dask]
  • GitFileSystem -\> pip install fsspec[git]
  • SMBFileSystem -\> pip install fsspec[smb]
  • LibArchiveFileSystem -\> pip install fsspec[libarchive]
  • OSSFileSystem -\> pip install ossfs
  • WebdavFileSystem -\> pip install webdav4
  • DVCFileSystem -\> pip install dvc
  • XRootDFileSystem -\> pip install fsspec-xrootd

This list of supported protocols is not exhaustive or could change in the future depending on the fsspec releases. You can find more information about the supported protocols on the fsspec documentation.

auto_awesome What this module does

AI-generated from the code · Odoo 19.0

Lets administrators define external file storage backends (local Odoo filestore, S3, SFTP, FTP, ZIP, and more) and test their connection from Odoo. Other modules can then route attachments to the right storage by model or by field.

This module adds a new configuration screen, FS Storage, under the Settings menu. There, an administrator creates a storage record with a name, a unique technical code, a protocol (the technology used to reach the files, such as the Odoo filestore, S3, SFTP, FTP, ZIP or memory), and a JSON block of connection options. The form shows the documentation and the list of available options for the chosen protocol, so users know what to fill in.

  • A "Test connection" button checks that the storage is reachable. Depending on the chosen check method, it either creates a small marker file or lists files at the root.
  • Options can be read from environment variables when the "Resolve env vars" flag is set, which avoids writing secrets directly in the record.
  • A directory path can be set to limit the storage to a sub-folder, and a cacheable flag controls whether the connection is reused.
  • Each storage can be linked to specific models or specific fields; attachments linked to those models or fields will be stored there. A model or a field can only belong to one storage, and Odoo blocks duplicates.
  • The code must be unique, and the options must be valid JSON.

The module also adds a storage link on models and fields, and a small wizard to run a connection test. It is a technical foundation used by other modules to store files outside the database.

Depends on

basebase_sparse_field

Menus it adds

menu_storagemenu_fs_storage
Models and fields (4)
  • ir.model · extends an existing modelstorage_id
  • fs.storage · new modelcode, name, options, protocol, field_ids, model_ids, field_xmlids, is_cacheable, model_xmlids, directory_path, protocol_descr, options_protocol (Describes Protocol), options_properties (Available properties), eval_options_from_env (Resolve env vars), check_connection_method
  • ir.model.fields · extends an existing modelstorage_id
  • fs.test.connection · new modelstorage_id, check_connection_method

Text generated by AI (DeepSeek) from reading the Odoo 19.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub

Availability by version

Reviewed: 2026-11-03
Confirmed (verified in repository and branch) Estimated (unverified) No information

Confirmation status: 4 confirmed, 5 with no information of 9 versions.

terminal Installation and usage

OCA documentation · Odoo 19.0

Configuration

When you create a new backend, you must specify the following:

  • The name of the backend. This is the name that will be used to identify the backend into Odoo
  • The code of the backend. This code will identify the backend into the store_fname field of the ir.attachment model. This code must be unique. It will be used as scheme. example of the store_fname field: odoofs://abs34Tg11.
  • The protocol used by the backend. The protocol refers to the supported protocols of the fsspec python package.
  • A directory path. This is a root directory from which the filesystem will be mounted. This directory must exist.
  • The protocol options. These are the options that will be passed to the fsspec python package when creating the filesystem. These options depend on the protocol used and are described in the fsspec documentation.
  • Resolve env vars. This options resolves the protocol options values starting with \$ from environment variables
  • Check Connection Method. If set, Odoo will always check the connection before using a storage and it will remove the fs connection from the cache if the check fails.
  • Create Marker file: create a hidden file on remote and then check it exists with Use it if you have write access to the remote and if it is not an issue to leave the marker file in the root directory.
  • List file: list all files from the root directory. You can use it if the directory path does not contain a big list of files (for performance reasons)

Some protocols defined in the fsspec package are wrappers around other protocols. For example, the SimpleCacheFileSystem protocol is a wrapper around any local filesystem protocol. In such cases, you must specify into the protocol options the protocol to be wrapped and the options to be passed to the wrapped protocol.

For example, if you want to create a backend that uses the SimpleCacheFileSystem protocol, after selecting the SimpleCacheFileSystem protocol, you must specify the protocol options as follows:

{
    "directory_path": "/tmp/my_backend",
    "target_protocol": "odoofs",
    "target_options": {...},
}

In this example, the SimpleCacheFileSystem protocol will be used as a wrapper around the odoofs protocol.

Server Environment

To ease the management of the filesystem storages configuration accross the different environments, the configuration of the filesystem storages can be defined in environment files or directly in the main configuration file. For example, the configuration of a filesystem storage with the code fsprod can be provided in the main configuration file as follows:

[fs_storage.fsprod]
protocol=s3
options={"endpoint_url": "https://my_s3_server/", "key": "KEY", "secret": "SECRET"}
directory_path=my_bucket

To work, a storage.backend record must exist with the code fsprod into the database. In your configuration section, you can specify the value for the following fields:

  • protocol
  • options
  • directory_path

When evaluating directory_path, {db_name} is replaced by the database name. This is usefull in multi-tenant with a setup completly controlled by configuration files.

Migration from storage_backend

The fs_storage addon can be used to replace the storage_backend addon. (It has been designed to be a drop-in replacement for the storage_backend addon). To ease the migration, the fs.storage model defines the high-level methods available in the storage_backend model. These methods are:

  • add
  • get
  • list_files
  • find_files
  • move_files
  • delete

These methods are wrappers around the methods of the fsspec.AbstractFileSystem class (see ). These methods are marked as deprecated and will be removed in a future version (V18) of the addon. You should use the methods of the fsspec.AbstractFileSystem class instead since they are more flexible and powerful. You can access the instance of the fsspec.AbstractFileSystem class using the fs property of a fs.storage record.

No verified information in OCA: Installation, Configuration.

info

Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.