Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
74c9205
Add module server_environment_data_encryption
florian-dacosta Apr 12, 2019
e49788d
[REF] Adapt method name after change is depency
florian-dacosta Oct 4, 2019
616adb8
[FIX] Make sure the generated view is always the same and the order o…
florian-dacosta Oct 4, 2019
2087d86
[UPD] Update server_environment_data_encryption.pot
oca-travis Mar 28, 2020
eb7491a
[UPD] README.rst
OCA-git-bot Mar 28, 2020
49ec410
[ADD] icon.png
OCA-git-bot Mar 28, 2020
7ba8206
[MIG] server_environment_data_encryption: migration to 13.0 (pre-commit)
ThomasBinsfeld Oct 5, 2020
2d6e4bc
[MIG] server_environment_data_encryption to 13.0
ThomasBinsfeld Oct 5, 2020
9c5b69f
[IMP] server_environment_data_encryption, data_encryption: black, iso…
mourad-ehm Oct 12, 2020
0eea800
[MIG] server_environment_data_encryption, data_encryption: Migration …
mourad-ehm Oct 12, 2020
61b3acc
[UPD] Update server_environment_data_encryption.pot
oca-travis Mar 5, 2021
c18db4b
[UPD] README.rst
OCA-git-bot Mar 5, 2021
286f025
[FIX] s_env_data_encryption: fix access right issues when using actions
sebalix Jan 31, 2022
a1cb1fe
server_environment_data_encryption 14.0.1.0.1
OCA-git-bot Feb 2, 2022
53ac4b9
Added translation using Weblate (Catalan)
ofonseca-pyming Feb 16, 2022
3a935ed
[IMP] update dotfiles [ci skip]
OCA-git-bot Mar 31, 2022
0d8abed
s_environment_data_encryption: no error when config is missing
florian-dacosta May 10, 2022
17fa694
[UPD] Update server_environment_data_encryption.pot
May 10, 2022
c6f61c8
server_environment_data_encryption 14.0.1.0.2
OCA-git-bot May 10, 2022
89d307a
Update translation files
oca-transbot May 10, 2022
07d4edc
[IMP] server_environment_data_encryption: black, isort, prettier
florian-dacosta Oct 9, 2022
4ffe9e9
[16][MIG] Migration of server_environment_data_encryption
florian-dacosta Oct 9, 2022
39bd6ee
[UPD] Update server_environment_data_encryption.pot
Oct 25, 2022
2892f5e
[UPD] README.rst
OCA-git-bot Oct 25, 2022
9d6e94d
Update translation files
weblate Oct 25, 2022
b4c862a
[UPD] Update server_environment_data_encryption.pot
Nov 25, 2022
ee7484c
Update translation files
weblate Nov 25, 2022
2146c9d
Added translation using Weblate (Spanish)
Ivorra78 Jul 25, 2023
6bce2c6
Translated using Weblate (Spanish)
Ivorra78 Jul 25, 2023
6e64a7c
[UPD] README.rst
OCA-git-bot Sep 3, 2023
92fc2f5
Added translation using Weblate (Italian)
mymage Jan 2, 2024
4315eea
Translated using Weblate (Italian)
mymage Jan 3, 2024
ac39a26
[IMP] server_environment_data_encryption: pre-commit auto fixes
florian-dacosta Mar 31, 2025
3347fac
[MIG] Migrate server_environment_data_encryption to 18
florian-dacosta Mar 31, 2025
c5ec631
[IMP] add test + set button invisible when we are not in the context …
florian-dacosta Apr 2, 2025
04b5eb9
[UPD] Update server_environment_data_encryption.pot
Apr 3, 2025
1210871
[BOT] post-merge updates
OCA-git-bot Apr 3, 2025
2d07e0a
[MIG] server_environment_data_encryption: Migration to v17.0 (backpor…
petrus-v Sep 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 21 additions & 11 deletions data_encryption/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,33 @@


class CommonDataEncrypted(TransactionCase):
def setUp(self):
super().setUp()
@classmethod
def setUpClass(cls):
super().setUpClass()

self.encrypted_data = self.env["encrypted.data"]
self.set_new_key_env("test")
self.old_running_env = config.get("running_env", "")
cls.encrypted_data = cls.env["encrypted.data"]
cls.set_new_key_env("test")
old_running_env = config.get("running_env", "")

def reset_running_env():
config["running_env"] = old_running_env

cls.addClassCleanup(reset_running_env)
config["running_env"] = "test"
self.crypted_data_name = "test_model,1"
cls.crypted_data_name = "test_model,1"

def set_new_key_env(self, environment):
@classmethod
def set_new_key_env(cls, environment):
crypting_key = Fernet.generate_key()
# The key is encoded to bytes in the module, because in real life
# the key com from the config file and is not in a binary format.
# So we decode here to avoid having a special behavior because of
# the tests.
config[f"encryption_key_{environment}"] = crypting_key.decode()
encryption_key_environment_config_name = f"encryption_key_{environment}"
old_key = config.get(encryption_key_environment_config_name, "")

def reset_config_key():
config[encryption_key_environment_config_name] = old_key

def tearDown(self):
config["running_env"] = self.old_running_env
return super().tearDown()
cls.addClassCleanup(reset_config_key)
config[encryption_key_environment_config_name] = crypting_key.decode()
128 changes: 128 additions & 0 deletions server_environment_data_encryption/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
==================================
Server Environment Data Encryption
==================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:d332eb4ca40eb79923ed865b069723db1c2f7be0946a840d9e1cd3197939915e
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png
:target: https://odoo-community.org/page/development-status
:alt: Alpha
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--env-lightgray.png?logo=github
:target: https://github.com/OCA/server-env/tree/17.0/server_environment_data_encryption
:alt: OCA/server-env
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/server-env-17-0/server-env-17-0-server_environment_data_encryption
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/server-env&target_branch=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module changes a little the behavior of server_environment modules.
When Odoo does not find the value of the field in the configuration
file, it will fallback on a Odoo encrypted field instead. Also it allows
you to configure the environment dependent fields for all your
environments from the production server.

.. IMPORTANT::
This is an alpha version, the data model and design can change at any time without warning.
Only for development or testing purpose, do not use in production.
`More details on development status <https://odoo-community.org/page/development-status>`_

**Table of contents**

.. contents::
:local:

Configuration
=============

In order to use this module properly, each environment should have their
own encryption key and the production environment should have the keys
of all environments.

Example : Development environment :

::

[options]
running_env=dev
encryption_key_dev=XXX

Pre-production environment :

::

[options]
running_env=preprod
encryption_key_preprod=YYY

Production environment :

::

[options]
running_env=prod
encryption_key_dev=XXX
encryption_key_preprod=YYY
encryption_key_prod=ZZZ

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-env/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 <https://github.com/OCA/server-env/issues/new?body=module:%20server_environment_data_encryption%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Akretion

Contributors
------------

- Florian da Costa <florian.dacosta@akretion.com>
- Sébastien Beau <sebastien.beau@akretion.com>
- Benoît Guillot <benoit.guillot@akretion.com>

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

.. |maintainer-florian-dacosta| image:: https://github.com/florian-dacosta.png?size=40px
:target: https://github.com/florian-dacosta
:alt: florian-dacosta

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-florian-dacosta|

This module is part of the `OCA/server-env <https://github.com/OCA/server-env/tree/17.0/server_environment_data_encryption>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions server_environment_data_encryption/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
13 changes: 13 additions & 0 deletions server_environment_data_encryption/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Server Environment Data Encryption",
"version": "17.0.1.0.0",
"development_status": "Alpha",
"maintainers": ["florian-dacosta"],
"category": "Tools",
"website": "https://github.com/OCA/server-env",
"author": "Akretion, Odoo Community Association (OCA)",
"license": "AGPL-3",
"installable": True,
"depends": ["server_environment", "data_encryption"],
}
49 changes: 49 additions & 0 deletions server_environment_data_encryption/i18n/ca.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * server_environment_data_encryption
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: ca\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"

#. module: server_environment_data_encryption
#. odoo-python
#: code:addons/server_environment_data_encryption/models/server_env_mixin.py:0
#, python-format
msgid "Define values for "
msgstr ""

#. module: server_environment_data_encryption
#: model:ir.model,name:server_environment_data_encryption.model_server_env_mixin
msgid "Mixin to add server environment in existing models"
msgstr ""

#. module: server_environment_data_encryption
#. odoo-python
#: code:addons/server_environment_data_encryption/models/server_env_mixin.py:0
#, python-format
msgid "Modify values for {} environment"
msgstr ""

#. module: server_environment_data_encryption
#. odoo-python
#: code:addons/server_environment_data_encryption/models/server_env_mixin.py:0
#, python-format
msgid "The encryption key for current environement is not defined"
msgstr ""

#. module: server_environment_data_encryption
#. odoo-python
#: code:addons/server_environment_data_encryption/models/server_env_mixin.py:0
#, python-format
msgid ""
"you need to define the running_env entry in your odoo configuration file"
msgstr ""
53 changes: 53 additions & 0 deletions server_environment_data_encryption/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * server_environment_data_encryption
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-07-25 13:10+0000\n"
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\n"
"Language-Team: none\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: server_environment_data_encryption
#. odoo-python
#: code:addons/server_environment_data_encryption/models/server_env_mixin.py:0
#, python-format
msgid "Define values for "
msgstr "Definir valores para "

#. module: server_environment_data_encryption
#: model:ir.model,name:server_environment_data_encryption.model_server_env_mixin
msgid "Mixin to add server environment in existing models"
msgstr "Combinación para añadir entorno de servidor en modelos existentes"

#. module: server_environment_data_encryption
#. odoo-python
#: code:addons/server_environment_data_encryption/models/server_env_mixin.py:0
#, python-format
msgid "Modify values for {} environment"
msgstr "Modificar los valores del entorno {}"

#. module: server_environment_data_encryption
#. odoo-python
#: code:addons/server_environment_data_encryption/models/server_env_mixin.py:0
#, python-format
msgid "The encryption key for current environement is not defined"
msgstr "La clave de encriptación para el entorno actual no está definida"

#. module: server_environment_data_encryption
#. odoo-python
#: code:addons/server_environment_data_encryption/models/server_env_mixin.py:0
#, python-format
msgid ""
"you need to define the running_env entry in your odoo configuration file"
msgstr ""
"necesitas definir la entrada running_env en tu archivo de configuración de "
"odoo"
51 changes: 51 additions & 0 deletions server_environment_data_encryption/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * server_environment_data_encryption
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-01-03 14:36+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: server_environment_data_encryption
#. odoo-python
#: code:addons/server_environment_data_encryption/models/server_env_mixin.py:0
#, python-format
msgid "Define values for "
msgstr "Definire valori per "

#. module: server_environment_data_encryption
#: model:ir.model,name:server_environment_data_encryption.model_server_env_mixin
msgid "Mixin to add server environment in existing models"
msgstr "Mixin per aggiungere l'ambiente server in modelli esistenti"

#. module: server_environment_data_encryption
#. odoo-python
#: code:addons/server_environment_data_encryption/models/server_env_mixin.py:0
#, python-format
msgid "Modify values for {} environment"
msgstr "Modificare valori per ambiente {}"

#. module: server_environment_data_encryption
#. odoo-python
#: code:addons/server_environment_data_encryption/models/server_env_mixin.py:0
#, python-format
msgid "The encryption key for current environement is not defined"
msgstr "La chiave di criptazione per l'ambiente attuale non è definita"

#. module: server_environment_data_encryption
#. odoo-python
#: code:addons/server_environment_data_encryption/models/server_env_mixin.py:0
#, python-format
msgid ""
"you need to define the running_env entry in your odoo configuration file"
msgstr "bisogna definire il valore running_env nel file di configruazione odoo"
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * server_environment_data_encryption
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: server_environment_data_encryption
#. odoo-python
#: code:addons/server_environment_data_encryption/models/server_env_mixin.py:0
msgid "Define values for "
msgstr ""

#. module: server_environment_data_encryption
#: model:ir.model,name:server_environment_data_encryption.model_server_env_mixin
msgid "Mixin to add server environment in existing models"
msgstr ""

#. module: server_environment_data_encryption
#. odoo-python
#: code:addons/server_environment_data_encryption/models/server_env_mixin.py:0
msgid "Modify values for {} environment"
msgstr ""

#. module: server_environment_data_encryption
#. odoo-python
#: code:addons/server_environment_data_encryption/models/server_env_mixin.py:0
msgid "The encryption key for current environement is not defined"
msgstr ""

#. module: server_environment_data_encryption
#. odoo-python
#: code:addons/server_environment_data_encryption/models/server_env_mixin.py:0
msgid ""
"you need to define the running_env entry in your odoo configuration file"
msgstr ""
1 change: 1 addition & 0 deletions server_environment_data_encryption/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import server_env_mixin
Loading