This module allows to encrypt and decrypt data. This module is not
usable by itself, it is a low level module which should work as a base
for others. An example is the module server_environment_data_encryption
To configure this module, you need to edit the main configuration file
of your instance, and add a directive called running_env. Commonly
used values are ‘dev’, ‘test’, ‘production’:
[options]
running_env=dev
You also need to set the encryption key(s). The main idea is to have
different encryption keys for your different environment, to avoid the
possibility to retrieve crucial information from the production
environment in a developement environment, for instance. So, if your
running environment is ‘dev’:
[options]
encryption_key_dev=fyeMIx9XVPBBky5XZeLDxVc9dFKy7Uzas3AoyMarHPA=
In the configuration file of your production environment, you may want
to configure all your other environments encryption key. This way, from
production you can encrypt and decrypt data for all environments.
You can generate keys with
python -c 'from cryptography.fernet import Fernet; print(Fernet.generate_key())'.
At the moment (November 2026), odoo pins the cryptography dependency to:
# https://github.com/odoo/odoo/blob/18.0/requirements.txt
cryptography==3.4.8; python_version < '3.12' # incompatibility between pyopenssl 19.0.0 and cryptography>=37.0.0
cryptography==42.0.8 ; python_version >= '3.12' # (Noble) min 41.0.7, pinning 42.0.8 for security fixes
cryptography==50.0.0 works with odoo on python3.12
cryptography==50.0.0 does not work with odoo on python3.11
For now the encryption is dependent on the environment. It has been
designed to store the same kind of data with different values depending
on the environement (dev, preprod, prod…). An improvement could be to
split this in 2 modules. But the environment stuff is not a big
constraint.
Bugs are tracked on GitHub Issues.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
feedback.
Do not contact contributors directly about support or help with technical issues.