From 0e62d14ed6b5cd541513d097eb6915f6dedcf5f0 Mon Sep 17 00:00:00 2001 From: Raphael Reverdy Date: Thu, 26 Nov 2026 11:32:23 +0100 Subject: [PATCH] data_encryption: revert to no pin on module. data_encryption module is compatible with old, recent, current versions of cryptography. Therefore it should not pin a version. I let the pinned version in requirements.txt for OCA pipeline in order to be aligned with odoo pining. --- data_encryption/README.rst | 15 +++++++++++++-- data_encryption/__manifest__.py | 8 +------- data_encryption/readme/CONFIGURE.md | 15 +++++++++++++-- data_encryption/static/description/index.html | 12 ++++++++++-- requirements.txt | 3 +-- test-requirements.txt | 3 +++ 6 files changed, 41 insertions(+), 15 deletions(-) diff --git a/data_encryption/README.rst b/data_encryption/README.rst index c0c0a5318..4c36b5d68 100644 --- a/data_encryption/README.rst +++ b/data_encryption/README.rst @@ -68,8 +68,19 @@ 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())'. +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 Known issues / Roadmap ====================== diff --git a/data_encryption/__manifest__.py b/data_encryption/__manifest__.py index 6d519093d..46a30218b 100644 --- a/data_encryption/__manifest__.py +++ b/data_encryption/__manifest__.py @@ -12,13 +12,7 @@ "license": "AGPL-3", "application": False, "installable": True, - "external_dependencies": { - # Use the same pin as Odoo to avoid compatibility issues - "python": [ - "cryptography==3.4.8; python_version < '3.12'", - "cryptography==42.0.8 ; python_version >= '3.12'", - ] - }, + "external_dependencies": {"python": ["cryptography"]}, "depends": ["base"], "data": ["security/ir.model.access.csv"], } diff --git a/data_encryption/readme/CONFIGURE.md b/data_encryption/readme/CONFIGURE.md index 4b7323bba..a209c9c83 100644 --- a/data_encryption/readme/CONFIGURE.md +++ b/data_encryption/readme/CONFIGURE.md @@ -18,5 +18,16 @@ 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())'. +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 diff --git a/data_encryption/static/description/index.html b/data_encryption/static/description/index.html index 228a1f4e4..a4c020d19 100644 --- a/data_encryption/static/description/index.html +++ b/data_encryption/static/description/index.html @@ -413,8 +413,16 @@

Configuration

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())’.

+

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

Known issues / Roadmap

diff --git a/requirements.txt b/requirements.txt index dd388a177..368c5c28f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,2 @@ # generated from manifests external_dependencies -cryptography==3.4.8; python_version < '3.12' -cryptography==42.0.8 ; python_version >= '3.12' +cryptography diff --git a/test-requirements.txt b/test-requirements.txt index 4ad8e0ece..57bf7dd46 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1 +1,4 @@ odoo-test-helper +# pin cryptography to same version as odoo (nov 26) +cryptography==3.4.8; python_version < '3.12' +cryptography==42.0.8 ; python_version >= '3.12'