Compare commits

...

No commits in common. "16.0" and "17.0" have entirely different histories.
16.0 ... 17.0

132 changed files with 530 additions and 5931 deletions

View File

@ -1,7 +1,9 @@
# Do NOT update manually; changes here will be overwritten by Copier
_commit: v1.17.2
_commit: v1.19
_src_path: gh:oca/oca-addons-repo-template
additional_ruff_rules: []
ci: GitHub
convert_readme_fragments_to_markdown: true
generate_requirements_txt: true
github_check_license: true
github_ci_extra_env: {}
@ -11,7 +13,7 @@ github_enable_stale_action: true
github_enforce_dev_status_compatibility: true
include_wkhtmltopdf: false
odoo_test_flavor: Both
odoo_version: 16.0
odoo_version: 17.0
org_name: Odoo Community Association (OCA)
org_slug: OCA
rebel_module_groups: []
@ -19,4 +21,6 @@ repo_description: 'TODO: add repo description.'
repo_name: server-env
repo_slug: server-env
repo_website: https://github.com/OCA/server-env
use_pyproject_toml: true
use_ruff: true

12
.flake8
View File

@ -1,12 +0,0 @@
[flake8]
max-line-length = 88
max-complexity = 16
# B = bugbear
# B9 = bugbear opinionated (incl line length)
select = C,E,F,W,B,B9
# E203: whitespace before ':' (black behaviour)
# E501: flake8 line length (covered by bugbear B950)
# W503: line break before binary operator (black behaviour)
ignore = E203,E501,W503
per-file-ignores=
__init__.py:F401

View File

@ -3,11 +3,11 @@ name: pre-commit
on:
pull_request:
branches:
- "16.0*"
- "17.0*"
push:
branches:
- "16.0"
- "16.0-ocabot-*"
- "17.0"
- "17.0-ocabot-*"
jobs:
pre-commit:

View File

@ -3,11 +3,11 @@ name: tests
on:
pull_request:
branches:
- "16.0*"
- "17.0*"
push:
branches:
- "16.0"
- "16.0-ocabot-*"
- "17.0"
- "17.0-ocabot-*"
jobs:
unreleased-deps:
@ -35,9 +35,9 @@ jobs:
fail-fast: false
matrix:
include:
- container: ghcr.io/oca/oca-ci/py3.10-odoo16.0:latest
- container: ghcr.io/oca/oca-ci/py3.10-odoo17.0:latest
name: test with Odoo
- container: ghcr.io/oca/oca-ci/py3.10-ocb16.0:latest
- container: ghcr.io/oca/oca-ci/py3.10-ocb17.0:latest
name: test with OCB
makepot: "true"
services:

1
.gitignore vendored
View File

@ -3,6 +3,7 @@ __pycache__/
*.py[cod]
/.venv
/.pytest_cache
/.ruff_cache
# C extensions
*.so

View File

@ -1,13 +0,0 @@
[settings]
; see https://github.com/psf/black
multi_line_output=3
include_trailing_comma=True
force_grid_wrap=0
combine_as_imports=True
use_parentheses=True
line_length=88
known_odoo=odoo
known_odoo_addons=odoo.addons
sections=FUTURE,STDLIB,THIRDPARTY,ODOO,ODOO_ADDONS,FIRSTPARTY,LOCALFOLDER
default_section=THIRDPARTY
ensure_newline_before_comments = True

View File

@ -14,6 +14,8 @@ exclude: |
^docs/_templates/.*\.html$|
# Don't bother non-technical authors with formatting issues in docs
readme/.*\.(rst|md)$|
# Ignore build and dist directories in addons
/build/|/dist/|
# You don't usually want a bot to modify your legal texts
(LICENSE.*|COPYING.*)
default_language_version:
@ -34,8 +36,12 @@ repos:
entry: found a en.po file
language: fail
files: '[a-zA-Z0-9_]*/i18n/en\.po$'
- repo: https://github.com/sbidoul/whool
rev: v0.5
hooks:
- id: whool-init
- repo: https://github.com/oca/maintainer-tools
rev: 969238e47c07d0c40573acff81d170f63245d738
rev: f71041f22b8cd68cf7c77b73a14ca8d8cd190a60
hooks:
# update the NOT INSTALLABLE ADDONS section above
- id: oca-update-pre-commit-excluded-addons
@ -44,30 +50,18 @@ repos:
- id: oca-gen-addon-readme
args:
- --addons-dir=.
- --branch=16.0
- --branch=17.0
- --org-name=OCA
- --repo-name=server-env
- --if-source-changed
- --keep-source-digest
- --convert-fragments-to-markdown
- id: oca-gen-external-dependencies
- repo: https://github.com/OCA/odoo-pre-commit-hooks
rev: v0.0.25
hooks:
- id: oca-checks-odoo-module
- id: oca-checks-po
- repo: https://github.com/myint/autoflake
rev: v1.6.1
hooks:
- id: autoflake
args:
- --expand-star-imports
- --ignore-init-module-imports
- --in-place
- --remove-all-unused-imports
- --remove-duplicate-keys
- --remove-unused-variables
- repo: https://github.com/psf/black
rev: 22.8.0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
hooks:
@ -109,35 +103,12 @@ repos:
- id: check-xml
- id: mixed-line-ending
args: ["--fix=lf"]
- repo: https://github.com/asottile/pyupgrade
rev: v2.38.2
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.3
hooks:
- id: pyupgrade
args: ["--keep-percent-format"]
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
name: isort except __init__.py
args:
- --settings=.
exclude: /__init__\.py$
- repo: https://github.com/acsone/setuptools-odoo
rev: 3.1.8
hooks:
- id: setuptools-odoo-make-default
- id: setuptools-odoo-get-requirements
args:
- --output
- requirements.txt
- --header
- "# generated from manifests external_dependencies"
- repo: https://github.com/PyCQA/flake8
rev: 3.9.2
hooks:
- id: flake8
name: flake8
additional_dependencies: ["flake8-bugbear==21.9.2"]
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
- repo: https://github.com/OCA/pylint-odoo
rev: v8.0.19
hooks:

View File

@ -10,7 +10,7 @@ manifest-required-authors=Odoo Community Association (OCA)
manifest-required-keys=license
manifest-deprecated-keys=description,active
license-allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3
valid-odoo-versions=16.0
valid-odoo-versions=17.0
[MESSAGES CONTROL]
disable=all

View File

@ -9,7 +9,7 @@ manifest-required-authors=Odoo Community Association (OCA)
manifest-required-keys=license
manifest-deprecated-keys=description,active
license-allowed=AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3
valid-odoo-versions=16.0
valid-odoo-versions=17.0
[MESSAGES CONTROL]
disable=all

29
.ruff.toml Normal file
View File

@ -0,0 +1,29 @@
target-version = "py310"
fix = true
[lint]
extend-select = [
"B",
"C90",
"I", # isort
"UP", # pyupgrade
]
exclude = ["setup/*"]
[format]
exclude = ["setup/*"]
[per-file-ignores]
"__init__.py" = ["F401", "I001"] # ignore unused and unsorted imports in __init__.py
"__manifest__.py" = ["B018"] # useless expression
[isort]
section-order = ["future", "standard-library", "third-party", "odoo", "odoo-addons", "first-party", "local-folder"]
[isort.sections]
"odoo" = ["odoo"]
"odoo-addons" = ["odoo.addons"]
[mccabe]
max-complexity = 16

View File

@ -1,9 +1,9 @@
[![Runboat](https://img.shields.io/badge/runboat-Try%20me-875A7B.png)](https://runboat.odoo-community.org/builds?repo=OCA/server-env&target_branch=16.0)
[![Pre-commit Status](https://github.com/OCA/server-env/actions/workflows/pre-commit.yml/badge.svg?branch=16.0)](https://github.com/OCA/server-env/actions/workflows/pre-commit.yml?query=branch%3A16.0)
[![Build Status](https://github.com/OCA/server-env/actions/workflows/test.yml/badge.svg?branch=16.0)](https://github.com/OCA/server-env/actions/workflows/test.yml?query=branch%3A16.0)
[![codecov](https://codecov.io/gh/OCA/server-env/branch/16.0/graph/badge.svg)](https://codecov.io/gh/OCA/server-env)
[![Translation Status](https://translation.odoo-community.org/widgets/server-env-16-0/-/svg-badge.svg)](https://translation.odoo-community.org/engage/server-env-16-0/?utm_source=widget)
[![Runboat](https://img.shields.io/badge/runboat-Try%20me-875A7B.png)](https://runboat.odoo-community.org/builds?repo=OCA/server-env&target_branch=17.0)
[![Pre-commit Status](https://github.com/OCA/server-env/actions/workflows/pre-commit.yml/badge.svg?branch=17.0)](https://github.com/OCA/server-env/actions/workflows/pre-commit.yml?query=branch%3A17.0)
[![Build Status](https://github.com/OCA/server-env/actions/workflows/test.yml/badge.svg?branch=17.0)](https://github.com/OCA/server-env/actions/workflows/test.yml?query=branch%3A17.0)
[![codecov](https://codecov.io/gh/OCA/server-env/branch/17.0/graph/badge.svg)](https://codecov.io/gh/OCA/server-env)
[![Translation Status](https://translation.odoo-community.org/widgets/server-env-17-0/-/svg-badge.svg)](https://translation.odoo-community.org/engage/server-env-17-0/?utm_source=widget)
<!-- /!\ do not modify above this line -->
@ -21,11 +21,7 @@ Available addons
----------------
addon | version | maintainers | summary
--- | --- | --- | ---
[data_encryption](data_encryption/) | 16.0.1.0.1 | | Store accounts and credentials encrypted by environment
[mail_environment](mail_environment/) | 16.0.1.0.1 | | Configure mail servers with server_environment_files
[server_environment](server_environment/) | 16.0.1.0.3 | | move some configurations out of the database
[server_environment_data_encryption](server_environment_data_encryption/) | 16.0.1.0.0 | | Server Environment Data Encryption
[server_environment_ir_config_parameter](server_environment_ir_config_parameter/) | 16.0.1.1.0 | | Override System Parameters from server environment file
[server_environment](server_environment/) | 17.0.1.0.0 | | move some configurations out of the database
[//]: # (end addons)

View File

@ -1,118 +0,0 @@
===============
Encryption data
===============
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:2d4447d50c16329e068a3699d69972506a62f5d3235b59046149e6aa76151e0e
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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/16.0/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-16-0/server-env-16-0-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=16.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
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
.. 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
=============
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())'.
Known issues / Roadmap
======================
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.
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:%20data_encryption%0Aversion:%2016.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
~~~~~~~~~~~~
* Raphaël Reverdy <raphael.reverdy@akretion.com>
* Florian da Costa <florian.dacosta@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.
This module is part of the `OCA/server-env <https://github.com/OCA/server-env/tree/16.0/data_encryption>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@ -1 +0,0 @@
from . import models

View File

@ -1,17 +0,0 @@
# Copyright <2019> Akretion
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Encryption data",
"summary": "Store accounts and credentials encrypted by environment",
"version": "16.0.1.0.1",
"development_status": "Alpha",
"category": "Tools",
"website": "https://github.com/OCA/server-env",
"author": "Akretion, Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"external_dependencies": {"python": ["cryptography"]},
"depends": ["base"],
"data": ["security/ir.model.access.csv"],
}

View File

@ -1,134 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * 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: data_encryption
#: model:ir.model.fields,help:data_encryption.field_encrypted_data__environment
msgid "Concerned Odoo environment (prod, preprod...)"
msgstr ""
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__create_uid
msgid "Created by"
msgstr ""
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__create_date
msgid "Created on"
msgstr ""
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__display_name
msgid "Display Name"
msgstr ""
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__encrypted_data
msgid "Encrypted Data"
msgstr ""
#. module: data_encryption
#. odoo-python
#: code:addons/data_encryption/models/encrypted_data.py:0
#, python-format
msgid "Encrypted data can only be read with suspended security (sudo)"
msgstr ""
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__environment
msgid "Environment"
msgstr ""
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__id
msgid "ID"
msgstr ""
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data____last_update
msgid "Last Modified on"
msgstr ""
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__write_uid
msgid "Last Updated by"
msgstr ""
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__write_date
msgid "Last Updated on"
msgstr ""
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__name
msgid "Name"
msgstr ""
#. module: data_encryption
#. odoo-python
#: code:addons/data_encryption/models/encrypted_data.py:0
#, python-format
msgid ""
"No '%(key_name)s' entry found in config file. Use a key similar to: %(key)s"
msgstr ""
#. module: data_encryption
#. odoo-python
#: code:addons/data_encryption/models/encrypted_data.py:0
#, python-format
msgid ""
"No environment found, please check your running_env entry in your config "
"file."
msgstr ""
#. module: data_encryption
#. odoo-python
#: code:addons/data_encryption/models/encrypted_data.py:0
#, python-format
msgid ""
"Password has been encrypted with a different key. Unless you can recover the "
"previous key, this password is unreadable."
msgstr ""
#. module: data_encryption
#: model:ir.model,name:data_encryption.model_encrypted_data
msgid "Store any encrypted data by environment"
msgstr ""
#. module: data_encryption
#: model:ir.model.fields,help:data_encryption.field_encrypted_data__name
msgid "Technical name"
msgstr ""
#. module: data_encryption
#. odoo-python
#: code:addons/data_encryption/models/encrypted_data.py:0
#, python-format
msgid "The data you are trying to read are not in a json format"
msgstr ""
#. module: data_encryption
#: model:ir.model.constraint,message:data_encryption.constraint_encrypted_data_name_environment_uniq
msgid ""
"You can not store multiple encrypted data for the same record and "
"environment"
msgstr ""
#. module: data_encryption
#. odoo-python
#: code:addons/data_encryption/models/encrypted_data.py:0
#, python-format
msgid "You can only encrypt data with suspended security (sudo)"
msgstr ""

View File

@ -1,133 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * data_encryption
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.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: data_encryption
#: model:ir.model.fields,help:data_encryption.field_encrypted_data__environment
msgid "Concerned Odoo environment (prod, preprod...)"
msgstr ""
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__create_uid
msgid "Created by"
msgstr ""
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__create_date
msgid "Created on"
msgstr ""
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__display_name
msgid "Display Name"
msgstr ""
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__encrypted_data
msgid "Encrypted Data"
msgstr ""
#. module: data_encryption
#. odoo-python
#: code:addons/data_encryption/models/encrypted_data.py:0
#, python-format
msgid "Encrypted data can only be read with suspended security (sudo)"
msgstr ""
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__environment
msgid "Environment"
msgstr ""
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__id
msgid "ID"
msgstr ""
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data____last_update
msgid "Last Modified on"
msgstr ""
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__write_uid
msgid "Last Updated by"
msgstr ""
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__write_date
msgid "Last Updated on"
msgstr ""
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__name
msgid "Name"
msgstr ""
#. module: data_encryption
#. odoo-python
#: code:addons/data_encryption/models/encrypted_data.py:0
#, python-format
msgid ""
"No '%(key_name)s' entry found in config file. Use a key similar to: %(key)s"
msgstr ""
#. module: data_encryption
#. odoo-python
#: code:addons/data_encryption/models/encrypted_data.py:0
#, python-format
msgid ""
"No environment found, please check your running_env entry in your config "
"file."
msgstr ""
#. module: data_encryption
#. odoo-python
#: code:addons/data_encryption/models/encrypted_data.py:0
#, python-format
msgid ""
"Password has been encrypted with a different key. Unless you can recover the"
" previous key, this password is unreadable."
msgstr ""
#. module: data_encryption
#: model:ir.model,name:data_encryption.model_encrypted_data
msgid "Store any encrypted data by environment"
msgstr ""
#. module: data_encryption
#: model:ir.model.fields,help:data_encryption.field_encrypted_data__name
msgid "Technical name"
msgstr ""
#. module: data_encryption
#. odoo-python
#: code:addons/data_encryption/models/encrypted_data.py:0
#, python-format
msgid "The data you are trying to read are not in a json format"
msgstr ""
#. module: data_encryption
#: model:ir.model.constraint,message:data_encryption.constraint_encrypted_data_name_environment_uniq
msgid ""
"You can not store multiple encrypted data for the same record and "
"environment"
msgstr ""
#. module: data_encryption
#. odoo-python
#: code:addons/data_encryption/models/encrypted_data.py:0
#, python-format
msgid "You can only encrypt data with suspended security (sudo)"
msgstr ""

View File

@ -1,136 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * data_encryption
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2022-11-04 14:45+0000\n"
"Last-Translator: Maria Sparenberg <maria.sparenberg@gmx.net>\n"
"Language-Team: none\n"
"Language: de\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.14.1\n"
#. module: data_encryption
#: model:ir.model.fields,help:data_encryption.field_encrypted_data__environment
msgid "Concerned Odoo environment (prod, preprod...)"
msgstr ""
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__create_uid
msgid "Created by"
msgstr "Erstellt von"
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__create_date
msgid "Created on"
msgstr "Erstellt am"
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__display_name
msgid "Display Name"
msgstr "Anzeigename"
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__encrypted_data
msgid "Encrypted Data"
msgstr ""
#. module: data_encryption
#. odoo-python
#: code:addons/data_encryption/models/encrypted_data.py:0
#, python-format
msgid "Encrypted data can only be read with suspended security (sudo)"
msgstr ""
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__environment
msgid "Environment"
msgstr ""
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__id
msgid "ID"
msgstr "ID"
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data____last_update
msgid "Last Modified on"
msgstr "Zuletzt geändert am"
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__write_uid
msgid "Last Updated by"
msgstr "Zuletzt aktualisiert von"
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__write_date
msgid "Last Updated on"
msgstr "Zuletzt aktualisiert am"
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__name
msgid "Name"
msgstr "Bezeichnung"
#. module: data_encryption
#. odoo-python
#: code:addons/data_encryption/models/encrypted_data.py:0
#, python-format
msgid ""
"No '%(key_name)s' entry found in config file. Use a key similar to: %(key)s"
msgstr ""
#. module: data_encryption
#. odoo-python
#: code:addons/data_encryption/models/encrypted_data.py:0
#, python-format
msgid ""
"No environment found, please check your running_env entry in your config "
"file."
msgstr ""
#. module: data_encryption
#. odoo-python
#: code:addons/data_encryption/models/encrypted_data.py:0
#, python-format
msgid ""
"Password has been encrypted with a different key. Unless you can recover the "
"previous key, this password is unreadable."
msgstr ""
#. module: data_encryption
#: model:ir.model,name:data_encryption.model_encrypted_data
msgid "Store any encrypted data by environment"
msgstr ""
#. module: data_encryption
#: model:ir.model.fields,help:data_encryption.field_encrypted_data__name
msgid "Technical name"
msgstr "Technischer Name"
#. module: data_encryption
#. odoo-python
#: code:addons/data_encryption/models/encrypted_data.py:0
#, python-format
msgid "The data you are trying to read are not in a json format"
msgstr ""
#. module: data_encryption
#: model:ir.model.constraint,message:data_encryption.constraint_encrypted_data_name_environment_uniq
msgid ""
"You can not store multiple encrypted data for the same record and "
"environment"
msgstr ""
#. module: data_encryption
#. odoo-python
#: code:addons/data_encryption/models/encrypted_data.py:0
#, python-format
msgid "You can only encrypt data with suspended security (sudo)"
msgstr ""

View File

@ -1,145 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * 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: data_encryption
#: model:ir.model.fields,help:data_encryption.field_encrypted_data__environment
msgid "Concerned Odoo environment (prod, preprod...)"
msgstr "Entorno Odoo concernido (prod, preprod...)"
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__create_uid
msgid "Created by"
msgstr "Creado por"
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__create_date
msgid "Created on"
msgstr "creado el"
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__display_name
msgid "Display Name"
msgstr "nombre a mostrar"
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__encrypted_data
msgid "Encrypted Data"
msgstr "Datos encriptados"
#. module: data_encryption
#. odoo-python
#: code:addons/data_encryption/models/encrypted_data.py:0
#, python-format
msgid "Encrypted data can only be read with suspended security (sudo)"
msgstr ""
"Los datos encriptados sólo pueden leerse con seguridad suspendida (sudo)"
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__environment
msgid "Environment"
msgstr "Ambiente"
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__id
msgid "ID"
msgstr "ID (identificación)"
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data____last_update
msgid "Last Modified on"
msgstr "Última Modificación el"
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__write_uid
msgid "Last Updated by"
msgstr "Última actualización por"
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__write_date
msgid "Last Updated on"
msgstr "Última Actualización el"
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__name
msgid "Name"
msgstr "Nombre"
#. module: data_encryption
#. odoo-python
#: code:addons/data_encryption/models/encrypted_data.py:0
#, python-format
msgid ""
"No '%(key_name)s' entry found in config file. Use a key similar to: %(key)s"
msgstr ""
"No se ha encontrado ninguna entrada '%(key_name)s' en el archivo de "
"configuración. Utilice una clave similar a: %(key)s"
#. module: data_encryption
#. odoo-python
#: code:addons/data_encryption/models/encrypted_data.py:0
#, python-format
msgid ""
"No environment found, please check your running_env entry in your config "
"file."
msgstr ""
"No se ha encontrado ningún entorno, compruebe la entrada running_env de su "
"archivo de configuración."
#. module: data_encryption
#. odoo-python
#: code:addons/data_encryption/models/encrypted_data.py:0
#, python-format
msgid ""
"Password has been encrypted with a different key. Unless you can recover the "
"previous key, this password is unreadable."
msgstr ""
"La contraseña ha sido encriptada con una clave diferente. A menos que puedas "
"recuperar la clave anterior, esta contraseña es ilegible."
#. module: data_encryption
#: model:ir.model,name:data_encryption.model_encrypted_data
msgid "Store any encrypted data by environment"
msgstr "Almacenar cualquier dato encriptado por entorno"
#. module: data_encryption
#: model:ir.model.fields,help:data_encryption.field_encrypted_data__name
msgid "Technical name"
msgstr "Nombre técnico"
#. module: data_encryption
#. odoo-python
#: code:addons/data_encryption/models/encrypted_data.py:0
#, python-format
msgid "The data you are trying to read are not in a json format"
msgstr "Los datos que intentas leer no están en formato json"
#. module: data_encryption
#: model:ir.model.constraint,message:data_encryption.constraint_encrypted_data_name_environment_uniq
msgid ""
"You can not store multiple encrypted data for the same record and "
"environment"
msgstr ""
"No se pueden almacenar varios datos encriptados para el mismo registro y "
"entorno"
#. module: data_encryption
#. odoo-python
#: code:addons/data_encryption/models/encrypted_data.py:0
#, python-format
msgid "You can only encrypt data with suspended security (sudo)"
msgstr "Sólo puede cifrar datos con seguridad suspendida (sudo)"

View File

@ -1,144 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * data_encryption
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-01-03 17:35+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: data_encryption
#: model:ir.model.fields,help:data_encryption.field_encrypted_data__environment
msgid "Concerned Odoo environment (prod, preprod...)"
msgstr "Riguardo all'ambinte Odoo (produzione, preproduzione...)"
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__create_uid
msgid "Created by"
msgstr "Creato da"
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__create_date
msgid "Created on"
msgstr "Creato il"
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__display_name
msgid "Display Name"
msgstr "Nome visualizzato"
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__encrypted_data
msgid "Encrypted Data"
msgstr "Dati criptati"
#. module: data_encryption
#. odoo-python
#: code:addons/data_encryption/models/encrypted_data.py:0
#, python-format
msgid "Encrypted data can only be read with suspended security (sudo)"
msgstr "I dati criptati possono essere letti slo con la sicrezza sospesa (sudo)"
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__environment
msgid "Environment"
msgstr "Ambiente"
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__id
msgid "ID"
msgstr "ID"
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data____last_update
msgid "Last Modified on"
msgstr "Ultima modifica il"
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__write_uid
msgid "Last Updated by"
msgstr "Ultimo aggiornamento di"
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__write_date
msgid "Last Updated on"
msgstr "Ultimo aggiornamento il"
#. module: data_encryption
#: model:ir.model.fields,field_description:data_encryption.field_encrypted_data__name
msgid "Name"
msgstr "Nome"
#. module: data_encryption
#. odoo-python
#: code:addons/data_encryption/models/encrypted_data.py:0
#, python-format
msgid ""
"No '%(key_name)s' entry found in config file. Use a key similar to: %(key)s"
msgstr ""
"Nessun valore trovato per '%(key_name)s' nel file configrazione. Usare una "
"chiave simile a: %(key)s"
#. module: data_encryption
#. odoo-python
#: code:addons/data_encryption/models/encrypted_data.py:0
#, python-format
msgid ""
"No environment found, please check your running_env entry in your config "
"file."
msgstr ""
"Nessun ambiente trovato, verificare il valore running_env nel file di "
"configurazione."
#. module: data_encryption
#. odoo-python
#: code:addons/data_encryption/models/encrypted_data.py:0
#, python-format
msgid ""
"Password has been encrypted with a different key. Unless you can recover the"
" previous key, this password is unreadable."
msgstr ""
"La password è stata criptata con un'altra chiave. Finché non si recupera la "
"chiave precedente, la password non è leggibile."
#. module: data_encryption
#: model:ir.model,name:data_encryption.model_encrypted_data
msgid "Store any encrypted data by environment"
msgstr "Deposita ogni dato criptato per ambiente"
#. module: data_encryption
#: model:ir.model.fields,help:data_encryption.field_encrypted_data__name
msgid "Technical name"
msgstr "Nome tecnico"
#. module: data_encryption
#. odoo-python
#: code:addons/data_encryption/models/encrypted_data.py:0
#, python-format
msgid "The data you are trying to read are not in a json format"
msgstr "I dati che si sta cercando di leggere non sono in formato JSON"
#. module: data_encryption
#: model:ir.model.constraint,message:data_encryption.constraint_encrypted_data_name_environment_uniq
msgid ""
"You can not store multiple encrypted data for the same record and "
"environment"
msgstr ""
"Non si possono depositare dati criptati multipli per lo stesso record "
"e ambiente"
#. module: data_encryption
#. odoo-python
#: code:addons/data_encryption/models/encrypted_data.py:0
#, python-format
msgid "You can only encrypt data with suspended security (sudo)"
msgstr "Si possono criptare i dati solo con la sicurezza sospesa (sudo)"

View File

@ -1 +0,0 @@
from . import encrypted_data

View File

@ -1,148 +0,0 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import json
import logging
from odoo import api, fields, models
from odoo.exceptions import AccessError, ValidationError
from odoo.tools import ormcache
from odoo.tools.config import config
from odoo.tools.translate import _
_logger = logging.getLogger(__name__)
try:
from cryptography.fernet import Fernet, InvalidToken
except ImportError as err: # pragma: no cover
_logger.debug(err)
class EncryptedData(models.Model):
"""Model to store encrypted data by environment (prod, preprod...)"""
_name = "encrypted.data"
_description = "Store any encrypted data by environment"
name = fields.Char(required=True, readonly=True, index=True, help="Technical name")
environment = fields.Char(
required=True,
index=True,
help="Concerned Odoo environment (prod, preprod...)",
)
encrypted_data = fields.Binary(attachment=False)
_sql_constraints = [
(
"name_environment_uniq",
"unique (name, environment)",
"You can not store multiple encrypted data for the same record and \
environment",
)
]
def _decrypt_data(self, env):
self.ensure_one()
cipher = self._get_cipher(env)
try:
return cipher.decrypt(self.encrypted_data).decode()
except InvalidToken as exc:
raise ValidationError(
_(
"Password has been encrypted with a different "
"key. Unless you can recover the previous key, "
"this password is unreadable."
)
) from exc
@api.model
@ormcache("self._uid", "name", "env")
def _encrypted_get(self, name, env=None):
if self.env.context.get("bin_size"):
self = self.with_context(bin_size=False)
if not self.env.su:
raise AccessError(
_("Encrypted data can only be read with suspended security (sudo)")
)
if not env:
env = self._retrieve_env()
encrypted_rec = self.search([("name", "=", name), ("environment", "=", env)])
if not encrypted_rec:
return None
return encrypted_rec._decrypt_data(env)
@api.model
@ormcache("self._uid", "name", "env")
def _encrypted_read_json(self, name, env=None):
data = self._encrypted_get(name, env=env)
if not data:
return {}
try:
return json.loads(data)
except (ValueError, TypeError) as exc:
raise ValidationError(
_("The data you are trying to read are not in a json format")
) from exc
@staticmethod
def _retrieve_env():
"""Return the current environment
Raise if none is found
"""
current = config.get("running_env", False)
if not current:
raise ValidationError(
_(
"No environment found, please check your running_env "
"entry in your config file."
)
)
return current
@classmethod
def _get_cipher(cls, env):
"""Return a cipher using the key of environment.
force_env = name of the env key.
Useful for encoding against one precise env
"""
key_name = "encryption_key_%s" % env
key_str = config.get(key_name)
if not key_str:
raise ValidationError(
_(
"No '%(key_name)s' entry found in config file. "
"Use a key similar to: %(key)s"
)
% {"key_name": key_name, "key": Fernet.generate_key()}
)
# key should be in bytes format
key = key_str.encode()
return Fernet(key)
@api.model
def _encrypt_data(self, data, env):
cipher = self._get_cipher(env)
if not isinstance(data, bytes):
data = data.encode()
return cipher.encrypt(data or "")
@api.model
def _encrypted_store(self, name, data, env=None):
if not self.env.su:
raise AccessError(
_("You can only encrypt data with suspended security (sudo)")
)
if not env:
env = self._retrieve_env()
encrypted_data = self._encrypt_data(data, env)
existing_data = self.search([("name", "=", name), ("environment", "=", env)])
if existing_data:
existing_data.write({"encrypted_data": encrypted_data})
else:
self.create(
{"name": name, "environment": env, "encrypted_data": encrypted_data}
)
self._encrypted_get.clear_cache(self)
self._encrypted_read_json.clear_cache(self)
@api.model
def _encrypted_store_json(self, name, json_data, env=None):
return self._encrypted_store(name, json.dumps(json_data), env=env)

View File

@ -1,21 +0,0 @@
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())'.

View File

@ -1,2 +0,0 @@
* Raphaël Reverdy <raphael.reverdy@akretion.com>
* Florian da Costa <florian.dacosta@akretion.com>

View File

@ -1,3 +0,0 @@
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

View File

@ -1,5 +0,0 @@
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.

View File

@ -1,2 +0,0 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_encrypted_data,access_encrypted_data,model_encrypted_data,base.group_system,0,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_encrypted_data access_encrypted_data model_encrypted_data base.group_system 0 0 0 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

View File

@ -1,462 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>Encryption data</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
border: 0 }
table.borderless td, table.borderless th {
/* Override padding for "table.docutils td" with "! important".
The right padding separates the table cells. */
padding: 0 0.5em 0 0 ! important }
.first {
/* Override more specific margin styles with "! important". */
margin-top: 0 ! important }
.last, .with-subtitle {
margin-bottom: 0 ! important }
.hidden {
display: none }
.subscript {
vertical-align: sub;
font-size: smaller }
.superscript {
vertical-align: super;
font-size: smaller }
a.toc-backref {
text-decoration: none ;
color: black }
blockquote.epigraph {
margin: 2em 5em ; }
dl.docutils dd {
margin-bottom: 0.5em }
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
overflow: hidden;
}
/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
font-weight: bold }
*/
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
color: red ;
font-weight: bold ;
font-family: sans-serif }
/* Uncomment (and remove this text!) to get reduced vertical space in
compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
margin-bottom: 0.5em }
div.compound .compound-last, div.compound .compound-middle {
margin-top: 0.5em }
*/
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em ;
margin-right: 2em }
div.footer, div.header {
clear: both;
font-size: smaller }
div.line-block {
display: block ;
margin-top: 1em ;
margin-bottom: 1em }
div.line-block div.line-block {
margin-top: 0 ;
margin-bottom: 0 ;
margin-left: 1.5em }
div.sidebar {
margin: 0 0 0.5em 1em ;
border: medium outset ;
padding: 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
margin-top: 0.4em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr.docutils {
width: 75% }
img.align-left, .figure.align-left, object.align-left, table.align-left {
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right, object.align-right, table.align-right {
clear: right ;
float: right ;
margin-left: 1em }
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
table.align-center {
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left }
.align-center {
clear: both ;
text-align: center }
.align-right {
text-align: right }
/* reset inner alignment in figures */
div.align-right {
text-align: inherit }
/* div.align-center * { */
/* text-align: left } */
.align-top {
vertical-align: top }
.align-middle {
vertical-align: middle }
.align-bottom {
vertical-align: bottom }
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font: inherit }
pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.pre {
white-space: pre }
span.problematic {
color: red }
span.section-subtitle {
/* font-size relative to parent (h1..h6 element) */
font-size: 80% }
table.citation {
border-left: solid 1px gray;
margin-left: 1px }
table.docinfo {
margin: 2em 4em }
table.docutils {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.footnote {
border-left: solid 1px black;
margin-left: 1px }
table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
table.docutils th.field-name, table.docinfo th.docinfo-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap ;
padding-left: 0 }
/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
border: 0px;
border-top: 2px solid;
border-bottom: 2px solid;
border-collapse: collapse;
}
table.docutils.booktabs * {
border: 0px;
}
table.docutils.booktabs th {
border-bottom: thin solid;
text-align: left;
}
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% }
ul.auto-toc {
list-style-type: none }
</style>
</head>
<body>
<div class="document" id="encryption-data">
<h1 class="title">Encryption data</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:2d4447d50c16329e068a3699d69972506a62f5d3235b59046149e6aa76151e0e
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Alpha" src="https://img.shields.io/badge/maturity-Alpha-red.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/server-env/tree/16.0/data_encryption"><img alt="OCA/server-env" src="https://img.shields.io/badge/github-OCA%2Fserver--env-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/server-env-16-0/server-env-16-0-data_encryption"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/server-env&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>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</p>
<div class="admonition important">
<p class="first admonition-title">Important</p>
<p class="last">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.
<a class="reference external" href="https://odoo-community.org/page/development-status">More details on development status</a></p>
</div>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#configuration" id="toc-entry-1">Configuration</a></li>
<li><a class="reference internal" href="#known-issues-roadmap" id="toc-entry-2">Known issues / Roadmap</a></li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-3">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-4">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-5">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-6">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-7">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="configuration">
<h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
<p>To configure this module, you need to edit the main configuration file
of your instance, and add a directive called <tt class="docutils literal">running_env</tt>. Commonly
used values are dev, test, production:</p>
<pre class="literal-block">
[options]
running_env=dev
</pre>
<p>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:</p>
<pre class="literal-block">
[options]
encryption_key_dev=fyeMIx9XVPBBky5XZeLDxVc9dFKy7Uzas3AoyMarHPA=
</pre>
<p>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.</p>
<p>You can generate keys with python -c from cryptography.fernet import Fernet; print(Fernet.generate_key()).</p>
</div>
<div class="section" id="known-issues-roadmap">
<h1><a class="toc-backref" href="#toc-entry-2">Known issues / Roadmap</a></h1>
<p>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.</p>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/server-env/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/server-env/issues/new?body=module:%20data_encryption%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#toc-entry-4">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#toc-entry-5">Authors</a></h2>
<ul class="simple">
<li>Akretion</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<ul class="simple">
<li>Raphaël Reverdy &lt;<a class="reference external" href="mailto:raphael.reverdy&#64;akretion.com">raphael.reverdy&#64;akretion.com</a>&gt;</li>
<li>Florian da Costa &lt;<a class="reference external" href="mailto:florian.dacosta&#64;akretion.com">florian.dacosta&#64;akretion.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-env/tree/16.0/data_encryption">OCA/server-env</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
</div>
</body>
</html>

View File

@ -1 +0,0 @@
from . import test_data_encrypt

View File

@ -1,36 +0,0 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import logging
from odoo.tests.common import TransactionCase
from odoo.tools.config import config
_logger = logging.getLogger(__name__)
try:
from cryptography.fernet import Fernet
except ImportError as err: # pragma: no cover
_logger.debug(err)
class CommonDataEncrypted(TransactionCase):
def setUp(self):
super().setUp()
self.encrypted_data = self.env["encrypted.data"]
self.set_new_key_env("test")
self.old_running_env = config.get("running_env", "")
config["running_env"] = "test"
self.crypted_data_name = "test_model,1"
def set_new_key_env(self, 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["encryption_key_{}".format(environment)] = crypting_key.decode()
def tearDown(self):
config["running_env"] = self.old_running_env
return super().tearDown()

View File

@ -1,92 +0,0 @@
# © 2016 Akretion Raphaël REVERDY
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import logging
from odoo.exceptions import AccessError, ValidationError
from odoo.tools.config import config
from .common import CommonDataEncrypted
_logger = logging.getLogger(__name__)
try:
from cryptography.fernet import Fernet
except ImportError as err: # pragma: no cover
_logger.debug(err)
class TestDataEncrypted(CommonDataEncrypted):
def test_store_data_no_superuser(self):
# only superuser can use this model
admin = self.env.ref("base.user_admin")
with self.assertRaises(AccessError):
self.encrypted_data.with_user(admin.id)._encrypted_store(
self.crypted_data_name, "My config"
)
def test_store_data_noenv_set(self):
config.pop("running_env", None)
with self.assertRaises(ValidationError):
self.encrypted_data.sudo()._encrypted_store(
self.crypted_data_name, "My config"
)
def test_store_data_nokey_set(self):
config.pop("encryption_key_test", None)
with self.assertRaises(ValidationError):
self.encrypted_data.sudo()._encrypted_store(
self.crypted_data_name, "My config"
)
def test_get_data_decrypted_and_cache(self):
self.encrypted_data.sudo()._encrypted_store("test_model,1", "My config")
data = self.encrypted_data.sudo()._encrypted_get(self.crypted_data_name)
self.assertEqual(data, "My config")
# Test cache really depends on user (super user) else any user could
# access the data
admin = self.env.ref("base.user_admin")
with self.assertRaises(AccessError):
self.encrypted_data.with_user(admin)._encrypted_get(self.crypted_data_name)
# Change value should invalidate cache
self.encrypted_data.sudo()._encrypted_store("test_model,1", "Other Config")
new_data = self.encrypted_data.sudo()._encrypted_get(self.crypted_data_name)
self.assertEqual(new_data, "Other Config")
def test_get_data_wrong_key(self):
self.encrypted_data.sudo()._encrypted_store("test_model,1", "My config")
new_key = Fernet.generate_key()
config["encryption_key_test"] = new_key.decode()
with self.assertRaises(ValidationError):
self.encrypted_data.sudo()._encrypted_get(self.crypted_data_name)
def test_get_empty_data(self):
empty_data = self.encrypted_data.sudo()._encrypted_get(self.crypted_data_name)
self.assertEqual(empty_data, None)
def test_get_wrong_json(self):
self.encrypted_data.sudo()._encrypted_store(self.crypted_data_name, "config")
with self.assertRaises(ValidationError):
self.encrypted_data.sudo()._encrypted_read_json(self.crypted_data_name)
def test_get_good_json(self):
self.encrypted_data.sudo()._encrypted_store_json(
self.crypted_data_name, {"key": "value"}
)
data = self.encrypted_data.sudo()._encrypted_read_json(self.crypted_data_name)
self.assertEqual(data, {"key": "value"})
def test_get_empty_json(self):
data = self.encrypted_data.sudo()._encrypted_read_json(self.crypted_data_name)
self.assertEqual(data, {})
def test_get_data_with_bin_size_context(self):
self.encrypted_data.sudo()._encrypted_store(self.crypted_data_name, "test")
data = (
self.encrypted_data.sudo()
.with_context(bin_size=True)
._encrypted_get(self.crypted_data_name)
)
self.assertEqual(data, "test")

View File

@ -1,146 +0,0 @@
==========================================
Mail configuration with server_environment
==========================================
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:98c12a3139202085663c933e6fb71273de1950ab8c96e24c2f0ba966a8860bea
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |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/16.0/mail_environment
: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-16-0/server-env-16-0-mail_environment
: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=16.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
This module allows to configure the incoming and outgoing mail servers
using the `server_environment` mechanism: you can then have different
mail servers for the production and the test environment.
**Table of contents**
.. contents::
:local:
Installation
============
To install this module, you need to have the server_environment module
installed and properly configured.
Configuration
=============
With this module installed, the incoming and outgoing mail servers are
configured in the `server_environment_files` module (which is a module
you should provide, see the documentation of `server_environment` for
more information).
In the configuration file of each environment, you may first use the
sections `[outgoing_mail]` and `[incoming_mail]` to configure the
default values respectively for SMTP servers and the IMAP/POP servers.
Then for each server, you can define additional values or override the
default values with a section named `[outgoing_mail.resource_name]` or
`[incoming_mail.resource_name]` where "resource_name" is the name of
the server.
Example of config file ::
[outgoing_mail]
smtp_host = smtp.myserver.com
smtp_port = 587
smtp_user =
smtp_pass =
smtp_encryption = ssl
[outgoing_mail.odoo_smtp_server1]
smtp_user = odoo
smtp_pass = odoo
[incoming_mail.odoo_pop_mail1]
server = mail.myserver.com
port = 110
server_type = pop
is_ssl = 0
attach = 0
original = 0
user = odoo@myserver.com
password = uas1ohV0
You will need to create 2 records in the database, one outgoing mail
server with the field `name` set to "odoo_smtp_server1" and one
incoming mail server with the field `name` set to "odoo_pop_mail1".
Usage
=====
Once configured, Odoo will read the mail servers values from the
configuration file related to each environment defined in the main
Odoo file.
Known issues / Roadmap
======================
* Due to the special nature of this addon, you cannot test it on the OCA
runbot.
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:%20mail_environment%0Aversion:%2016.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
~~~~~~~
* Camptocamp
Contributors
~~~~~~~~~~~~
* Nicolas Bessi <nicolas.bessi@camptocamp.com>
* Yannick Vaucher <yannick.vaucher@camptocamp.com>
* Guewen Baconnier <guewen.baconnier@camptocamp.com>
* Joël Grand-Guillaume <joel.grandguillaume@camptocamp.com>
* Holger Brunn <hbrunn@therp.nl>
* Alexandre Fayolle <alexandre.fayolle@camptocamp.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.
This module is part of the `OCA/server-env <https://github.com/OCA/server-env/tree/16.0/mail_environment>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@ -1 +0,0 @@
from . import models

View File

@ -1,13 +0,0 @@
# Copyright 2012-2018 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
{
"name": "Mail configuration with server_environment",
"version": "16.0.1.0.1",
"category": "Tools",
"summary": "Configure mail servers with server_environment_files",
"author": "Camptocamp, Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://github.com/OCA/server-env",
"depends": ["mail", "server_environment"],
}

View File

@ -1,62 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_environment
#
# Translators:
# Rudolf Schnapka <rs@techno-flex.de>, 2016
msgid ""
msgstr ""
"Project-Id-Version: server-tools (9.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-04-17 12:15+0000\n"
"PO-Revision-Date: 2016-04-21 09:16+0000\n"
"Last-Translator: Rudolf Schnapka <rs@techno-flex.de>\n"
"Language-Team: German (http://www.transifex.com/oca/OCA-server-tools-9-0/"
"language/de/)\n"
"Language: de\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: mail_environment
#: model:ir.model.fields,help:mail_environment.field_fetchmail_server__is_ssl
msgid ""
"Connections are encrypted with SSL/TLS through a dedicated port (default: "
"IMAPS=993, POP3S=995)"
msgstr ""
#. module: mail_environment
#: model:ir.model,name:mail_environment.model_fetchmail_server
msgid "Incoming Mail Server"
msgstr ""
#. module: mail_environment
#: model:ir.model,name:mail_environment.model_ir_mail_server
#, fuzzy
msgid "Mail Server"
msgstr "ir.mail_server"
#. module: mail_environment
#: model:ir.model.fields,field_description:mail_environment.field_fetchmail_server__is_ssl
msgid "SSL/TLS"
msgstr ""
#. module: mail_environment
#: model:ir.model.fields,field_description:mail_environment.field_fetchmail_server__server_env_defaults
#: model:ir.model.fields,field_description:mail_environment.field_ir_mail_server__server_env_defaults
msgid "Server Env Defaults"
msgstr ""
#. module: mail_environment
#: model:ir.model.fields,field_description:mail_environment.field_fetchmail_server__server_type
msgid "Server Type"
msgstr ""
#, fuzzy
#~ msgid "IMAP Server"
#~ msgstr "POP/IMAP-Server"
#, fuzzy
#~ msgid "POP Server"
#~ msgstr "POP/IMAP-Server"

View File

@ -1,55 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_environment
#
# Translators:
# Pedro M. Baeza <pedro.baeza@gmail.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-05-01 10:38+0000\n"
"PO-Revision-Date: 2023-07-25 13:10+0000\n"
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\n"
"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\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: mail_environment
#: model:ir.model.fields,help:mail_environment.field_fetchmail_server__is_ssl
msgid ""
"Connections are encrypted with SSL/TLS through a dedicated port (default: "
"IMAPS=993, POP3S=995)"
msgstr ""
"Las conexiones se cifran con SSL/TLS a través de un puerto dedicado (por "
"defecto: IMAPS=993, POP3S=995)"
#. module: mail_environment
#: model:ir.model,name:mail_environment.model_fetchmail_server
msgid "Incoming Mail Server"
msgstr "Servidor de correo entrante"
#. module: mail_environment
#: model:ir.model,name:mail_environment.model_ir_mail_server
msgid "Mail Server"
msgstr "Servidor de correo"
#. module: mail_environment
#: model:ir.model.fields,field_description:mail_environment.field_fetchmail_server__is_ssl
msgid "SSL/TLS"
msgstr "SSL/TLS"
#. module: mail_environment
#: model:ir.model.fields,field_description:mail_environment.field_fetchmail_server__server_env_defaults
#: model:ir.model.fields,field_description:mail_environment.field_ir_mail_server__server_env_defaults
msgid "Server Env Defaults"
msgstr "Valores por defecto del entorno de servidor"
#. module: mail_environment
#: model:ir.model.fields,field_description:mail_environment.field_fetchmail_server__server_type
msgid "Server Type"
msgstr "Tipo de servidor"

View File

@ -1,63 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_environment
#
# Translators:
# Bole <bole@dajmi5.com>, 2016
msgid ""
msgstr ""
"Project-Id-Version: server-tools (9.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-06-29 00:48+0000\n"
"PO-Revision-Date: 2016-06-14 10:58+0000\n"
"Last-Translator: Bole <bole@dajmi5.com>\n"
"Language-Team: Croatian (http://www.transifex.com/oca/OCA-server-tools-9-0/"
"language/hr/)\n"
"Language: hr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
#. module: mail_environment
#: model:ir.model.fields,help:mail_environment.field_fetchmail_server__is_ssl
msgid ""
"Connections are encrypted with SSL/TLS through a dedicated port (default: "
"IMAPS=993, POP3S=995)"
msgstr ""
#. module: mail_environment
#: model:ir.model,name:mail_environment.model_fetchmail_server
msgid "Incoming Mail Server"
msgstr ""
#. module: mail_environment
#: model:ir.model,name:mail_environment.model_ir_mail_server
#, fuzzy
msgid "Mail Server"
msgstr "ir.mail_server"
#. module: mail_environment
#: model:ir.model.fields,field_description:mail_environment.field_fetchmail_server__is_ssl
msgid "SSL/TLS"
msgstr ""
#. module: mail_environment
#: model:ir.model.fields,field_description:mail_environment.field_fetchmail_server__server_env_defaults
#: model:ir.model.fields,field_description:mail_environment.field_ir_mail_server__server_env_defaults
msgid "Server Env Defaults"
msgstr ""
#. module: mail_environment
#: model:ir.model.fields,field_description:mail_environment.field_fetchmail_server__server_type
msgid "Server Type"
msgstr ""
#, fuzzy
#~ msgid "IMAP Server"
#~ msgstr "POP/IMAP Server"
#, fuzzy
#~ msgid "POP Server"
#~ msgstr "POP/IMAP Server"

View File

@ -1,52 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_environment
#
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: mail_environment
#: model:ir.model.fields,help:mail_environment.field_fetchmail_server__is_ssl
msgid ""
"Connections are encrypted with SSL/TLS through a dedicated port (default: "
"IMAPS=993, POP3S=995)"
msgstr ""
"Le connessioni sono criptate con SSL/TLS attraverso una porta dedicata "
"(predefinite: IMAPS=993, POP3S=995)"
#. module: mail_environment
#: model:ir.model,name:mail_environment.model_fetchmail_server
msgid "Incoming Mail Server"
msgstr "Server di posta in arrivo"
#. module: mail_environment
#: model:ir.model,name:mail_environment.model_ir_mail_server
msgid "Mail Server"
msgstr "Server di posta"
#. module: mail_environment
#: model:ir.model.fields,field_description:mail_environment.field_fetchmail_server__is_ssl
msgid "SSL/TLS"
msgstr "SSL/TLS"
#. module: mail_environment
#: model:ir.model.fields,field_description:mail_environment.field_fetchmail_server__server_env_defaults
#: model:ir.model.fields,field_description:mail_environment.field_ir_mail_server__server_env_defaults
msgid "Server Env Defaults"
msgstr "Server ambiente predefinito"
#. module: mail_environment
#: model:ir.model.fields,field_description:mail_environment.field_fetchmail_server__server_type
msgid "Server Type"
msgstr "Tipo servizio"

View File

@ -1,47 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_environment
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.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: mail_environment
#: model:ir.model.fields,help:mail_environment.field_fetchmail_server__is_ssl
msgid ""
"Connections are encrypted with SSL/TLS through a dedicated port (default: "
"IMAPS=993, POP3S=995)"
msgstr ""
#. module: mail_environment
#: model:ir.model,name:mail_environment.model_fetchmail_server
msgid "Incoming Mail Server"
msgstr ""
#. module: mail_environment
#: model:ir.model,name:mail_environment.model_ir_mail_server
msgid "Mail Server"
msgstr ""
#. module: mail_environment
#: model:ir.model.fields,field_description:mail_environment.field_fetchmail_server__is_ssl
msgid "SSL/TLS"
msgstr ""
#. module: mail_environment
#: model:ir.model.fields,field_description:mail_environment.field_fetchmail_server__server_env_defaults
#: model:ir.model.fields,field_description:mail_environment.field_ir_mail_server__server_env_defaults
msgid "Server Env Defaults"
msgstr ""
#. module: mail_environment
#: model:ir.model.fields,field_description:mail_environment.field_fetchmail_server__server_type
msgid "Server Type"
msgstr ""

View File

@ -1,62 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_environment
#
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: server-tools (8.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-09-29 11:14+0000\n"
"PO-Revision-Date: 2019-09-03 01:23+0000\n"
"Last-Translator: Rodrigo Macedo <rmsolucoeseminformatic4@gmail.com>\n"
"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-server-"
"tools-8-0/language/pt_BR/)\n"
"Language: pt_BR\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 3.8\n"
#. module: mail_environment
#: model:ir.model.fields,help:mail_environment.field_fetchmail_server__is_ssl
msgid ""
"Connections are encrypted with SSL/TLS through a dedicated port (default: "
"IMAPS=993, POP3S=995)"
msgstr ""
#. module: mail_environment
#: model:ir.model,name:mail_environment.model_fetchmail_server
msgid "Incoming Mail Server"
msgstr "Servidor de Mensagens Recebidas"
#. module: mail_environment
#: model:ir.model,name:mail_environment.model_ir_mail_server
msgid "Mail Server"
msgstr "Servidor de E-mail"
#. module: mail_environment
#: model:ir.model.fields,field_description:mail_environment.field_fetchmail_server__is_ssl
msgid "SSL/TLS"
msgstr ""
#. module: mail_environment
#: model:ir.model.fields,field_description:mail_environment.field_fetchmail_server__server_env_defaults
#: model:ir.model.fields,field_description:mail_environment.field_ir_mail_server__server_env_defaults
msgid "Server Env Defaults"
msgstr ""
#. module: mail_environment
#: model:ir.model.fields,field_description:mail_environment.field_fetchmail_server__server_type
msgid "Server Type"
msgstr "Tipo de Servidor"
#~ msgid "IMAP Server"
#~ msgstr "Servidor IMAP"
#~ msgid "Local Server"
#~ msgstr "Servidor Local"
#~ msgid "POP Server"
#~ msgstr "Servidor POP"

View File

@ -1,63 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_environment
#
# Translators:
# Matjaž Mozetič <m.mozetic@matmoz.si>, 2016
msgid ""
msgstr ""
"Project-Id-Version: server-tools (9.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-02-27 01:37+0000\n"
"PO-Revision-Date: 2016-02-27 16:56+0000\n"
"Last-Translator: Matjaž Mozetič <m.mozetic@matmoz.si>\n"
"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-server-tools-9-0/"
"language/sl/)\n"
"Language: sl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n"
"%100==4 ? 2 : 3);\n"
#. module: mail_environment
#: model:ir.model.fields,help:mail_environment.field_fetchmail_server__is_ssl
msgid ""
"Connections are encrypted with SSL/TLS through a dedicated port (default: "
"IMAPS=993, POP3S=995)"
msgstr ""
#. module: mail_environment
#: model:ir.model,name:mail_environment.model_fetchmail_server
msgid "Incoming Mail Server"
msgstr ""
#. module: mail_environment
#: model:ir.model,name:mail_environment.model_ir_mail_server
#, fuzzy
msgid "Mail Server"
msgstr "ir.mail_server"
#. module: mail_environment
#: model:ir.model.fields,field_description:mail_environment.field_fetchmail_server__is_ssl
msgid "SSL/TLS"
msgstr ""
#. module: mail_environment
#: model:ir.model.fields,field_description:mail_environment.field_fetchmail_server__server_env_defaults
#: model:ir.model.fields,field_description:mail_environment.field_ir_mail_server__server_env_defaults
msgid "Server Env Defaults"
msgstr ""
#. module: mail_environment
#: model:ir.model.fields,field_description:mail_environment.field_fetchmail_server__server_type
msgid "Server Type"
msgstr ""
#, fuzzy
#~ msgid "IMAP Server"
#~ msgstr "POP/IMAP strežnik"
#, fuzzy
#~ msgid "POP Server"
#~ msgstr "POP/IMAP strežnik"

View File

@ -1,62 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_environment
#
# Translators:
# Jeffery Chenn <jeffery9@gmail.com>, 2016
msgid ""
msgstr ""
"Project-Id-Version: server-tools (9.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-08-31 11:58+0000\n"
"PO-Revision-Date: 2016-09-04 06:08+0000\n"
"Last-Translator: Jeffery Chenn <jeffery9@gmail.com>\n"
"Language-Team: Chinese (China) (http://www.transifex.com/oca/OCA-server-"
"tools-9-0/language/zh_CN/)\n"
"Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=1; plural=0;\n"
#. module: mail_environment
#: model:ir.model.fields,help:mail_environment.field_fetchmail_server__is_ssl
msgid ""
"Connections are encrypted with SSL/TLS through a dedicated port (default: "
"IMAPS=993, POP3S=995)"
msgstr ""
#. module: mail_environment
#: model:ir.model,name:mail_environment.model_fetchmail_server
msgid "Incoming Mail Server"
msgstr ""
#. module: mail_environment
#: model:ir.model,name:mail_environment.model_ir_mail_server
#, fuzzy
msgid "Mail Server"
msgstr "POP/IMAP 服务器"
#. module: mail_environment
#: model:ir.model.fields,field_description:mail_environment.field_fetchmail_server__is_ssl
msgid "SSL/TLS"
msgstr ""
#. module: mail_environment
#: model:ir.model.fields,field_description:mail_environment.field_fetchmail_server__server_env_defaults
#: model:ir.model.fields,field_description:mail_environment.field_ir_mail_server__server_env_defaults
msgid "Server Env Defaults"
msgstr ""
#. module: mail_environment
#: model:ir.model.fields,field_description:mail_environment.field_fetchmail_server__server_type
msgid "Server Type"
msgstr ""
#, fuzzy
#~ msgid "IMAP Server"
#~ msgstr "POP/IMAP 服务器"
#, fuzzy
#~ msgid "POP Server"
#~ msgstr "POP/IMAP 服务器"

View File

@ -1,2 +0,0 @@
from . import ir_mail_server
from . import fetchmail_server

View File

@ -1,70 +0,0 @@
# Copyright 2012-2018 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
import operator
from odoo import api, fields, models
from odoo.osv.expression import FALSE_DOMAIN
class FetchmailServer(models.Model):
"""Incoming POP/IMAP mail server account"""
_name = "fetchmail.server"
_inherit = ["fetchmail.server", "server.env.mixin"]
@property
def _server_env_fields(self):
base_fields = super()._server_env_fields
mail_fields = {
"server": {},
"port": {},
"server_type": {},
"user": {},
"password": {},
"is_ssl": {},
"attach": {},
"original": {},
}
mail_fields.update(base_fields)
return mail_fields
is_ssl = fields.Boolean(search="_search_is_ssl")
server_type = fields.Selection(search="_search_server_type")
@api.model
def _server_env_global_section_name(self):
"""Name of the global section in the configuration files
Can be customized in your model
"""
return "incoming_mail"
@api.model
def _search_is_ssl(self, oper, value):
"""Keep the is_ssl field searchable to allow domain in search view."""
if not isinstance(value, bool):
return FALSE_DOMAIN
operators = {
"=": operator.eq,
"!=": operator.ne,
}
if oper not in operators:
return FALSE_DOMAIN
servers = self.search([]).filtered(lambda s: operators[oper](value, s.is_ssl))
return [("id", "in", servers.ids)]
@api.model
def _search_server_type(self, oper, value):
operators = {
"=": operator.eq,
"!=": operator.ne,
"in": operator.contains,
"not in": lambda a, b: not operator.contains(a, b),
}
if oper not in operators:
return [("id", "in", [])]
servers = self.search([]).filtered(
lambda s: operators[oper](value, s.server_type)
)
return [("id", "in", servers.ids)]

View File

@ -1,30 +0,0 @@
# Copyright 2012-2018 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
from odoo import api, models
class IrMailServer(models.Model):
_name = "ir.mail_server"
_inherit = ["ir.mail_server", "server.env.mixin"]
@property
def _server_env_fields(self):
base_fields = super()._server_env_fields
mail_fields = {
"smtp_host": {},
"smtp_port": {},
"smtp_user": {},
"smtp_pass": {},
"smtp_encryption": {},
}
mail_fields.update(base_fields)
return mail_fields
@api.model
def _server_env_global_section_name(self):
"""Name of the global section in the configuration files
Can be customized in your model
"""
return "outgoing_mail"

View File

@ -1,40 +0,0 @@
With this module installed, the incoming and outgoing mail servers are
configured in the `server_environment_files` module (which is a module
you should provide, see the documentation of `server_environment` for
more information).
In the configuration file of each environment, you may first use the
sections `[outgoing_mail]` and `[incoming_mail]` to configure the
default values respectively for SMTP servers and the IMAP/POP servers.
Then for each server, you can define additional values or override the
default values with a section named `[outgoing_mail.resource_name]` or
`[incoming_mail.resource_name]` where "resource_name" is the name of
the server.
Example of config file ::
[outgoing_mail]
smtp_host = smtp.myserver.com
smtp_port = 587
smtp_user =
smtp_pass =
smtp_encryption = ssl
[outgoing_mail.odoo_smtp_server1]
smtp_user = odoo
smtp_pass = odoo
[incoming_mail.odoo_pop_mail1]
server = mail.myserver.com
port = 110
server_type = pop
is_ssl = 0
attach = 0
original = 0
user = odoo@myserver.com
password = uas1ohV0
You will need to create 2 records in the database, one outgoing mail
server with the field `name` set to "odoo_smtp_server1" and one
incoming mail server with the field `name` set to "odoo_pop_mail1".

View File

@ -1,6 +0,0 @@
* Nicolas Bessi <nicolas.bessi@camptocamp.com>
* Yannick Vaucher <yannick.vaucher@camptocamp.com>
* Guewen Baconnier <guewen.baconnier@camptocamp.com>
* Joël Grand-Guillaume <joel.grandguillaume@camptocamp.com>
* Holger Brunn <hbrunn@therp.nl>
* Alexandre Fayolle <alexandre.fayolle@camptocamp.com>

View File

@ -1,3 +0,0 @@
This module allows to configure the incoming and outgoing mail servers
using the `server_environment` mechanism: you can then have different
mail servers for the production and the test environment.

View File

@ -1,2 +0,0 @@
To install this module, you need to have the server_environment module
installed and properly configured.

View File

@ -1,2 +0,0 @@
* Due to the special nature of this addon, you cannot test it on the OCA
runbot.

View File

@ -1,3 +0,0 @@
Once configured, Odoo will read the mail servers values from the
configuration file related to each environment defined in the main
Odoo file.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

View File

@ -1,490 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>Mail configuration with server_environment</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
border: 0 }
table.borderless td, table.borderless th {
/* Override padding for "table.docutils td" with "! important".
The right padding separates the table cells. */
padding: 0 0.5em 0 0 ! important }
.first {
/* Override more specific margin styles with "! important". */
margin-top: 0 ! important }
.last, .with-subtitle {
margin-bottom: 0 ! important }
.hidden {
display: none }
.subscript {
vertical-align: sub;
font-size: smaller }
.superscript {
vertical-align: super;
font-size: smaller }
a.toc-backref {
text-decoration: none ;
color: black }
blockquote.epigraph {
margin: 2em 5em ; }
dl.docutils dd {
margin-bottom: 0.5em }
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
overflow: hidden;
}
/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
font-weight: bold }
*/
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
color: red ;
font-weight: bold ;
font-family: sans-serif }
/* Uncomment (and remove this text!) to get reduced vertical space in
compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
margin-bottom: 0.5em }
div.compound .compound-last, div.compound .compound-middle {
margin-top: 0.5em }
*/
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em ;
margin-right: 2em }
div.footer, div.header {
clear: both;
font-size: smaller }
div.line-block {
display: block ;
margin-top: 1em ;
margin-bottom: 1em }
div.line-block div.line-block {
margin-top: 0 ;
margin-bottom: 0 ;
margin-left: 1.5em }
div.sidebar {
margin: 0 0 0.5em 1em ;
border: medium outset ;
padding: 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
margin-top: 0.4em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr.docutils {
width: 75% }
img.align-left, .figure.align-left, object.align-left, table.align-left {
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right, object.align-right, table.align-right {
clear: right ;
float: right ;
margin-left: 1em }
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
table.align-center {
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left }
.align-center {
clear: both ;
text-align: center }
.align-right {
text-align: right }
/* reset inner alignment in figures */
div.align-right {
text-align: inherit }
/* div.align-center * { */
/* text-align: left } */
.align-top {
vertical-align: top }
.align-middle {
vertical-align: middle }
.align-bottom {
vertical-align: bottom }
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font: inherit }
pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.pre {
white-space: pre }
span.problematic {
color: red }
span.section-subtitle {
/* font-size relative to parent (h1..h6 element) */
font-size: 80% }
table.citation {
border-left: solid 1px gray;
margin-left: 1px }
table.docinfo {
margin: 2em 4em }
table.docutils {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.footnote {
border-left: solid 1px black;
margin-left: 1px }
table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
table.docutils th.field-name, table.docinfo th.docinfo-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap ;
padding-left: 0 }
/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
border: 0px;
border-top: 2px solid;
border-bottom: 2px solid;
border-collapse: collapse;
}
table.docutils.booktabs * {
border: 0px;
}
table.docutils.booktabs th {
border-bottom: thin solid;
text-align: left;
}
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% }
ul.auto-toc {
list-style-type: none }
</style>
</head>
<body>
<div class="document" id="mail-configuration-with-server-environment">
<h1 class="title">Mail configuration with server_environment</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:98c12a3139202085663c933e6fb71273de1950ab8c96e24c2f0ba966a8860bea
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/server-env/tree/16.0/mail_environment"><img alt="OCA/server-env" src="https://img.shields.io/badge/github-OCA%2Fserver--env-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/server-env-16-0/server-env-16-0-mail_environment"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/server-env&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module allows to configure the incoming and outgoing mail servers
using the <cite>server_environment</cite> mechanism: you can then have different
mail servers for the production and the test environment.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#installation" id="toc-entry-1">Installation</a></li>
<li><a class="reference internal" href="#configuration" id="toc-entry-2">Configuration</a></li>
<li><a class="reference internal" href="#usage" id="toc-entry-3">Usage</a></li>
<li><a class="reference internal" href="#known-issues-roadmap" id="toc-entry-4">Known issues / Roadmap</a></li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-5">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-6">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-7">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-8">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-9">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="installation">
<h1><a class="toc-backref" href="#toc-entry-1">Installation</a></h1>
<p>To install this module, you need to have the server_environment module
installed and properly configured.</p>
</div>
<div class="section" id="configuration">
<h1><a class="toc-backref" href="#toc-entry-2">Configuration</a></h1>
<p>With this module installed, the incoming and outgoing mail servers are
configured in the <cite>server_environment_files</cite> module (which is a module
you should provide, see the documentation of <cite>server_environment</cite> for
more information).</p>
<p>In the configuration file of each environment, you may first use the
sections <cite>[outgoing_mail]</cite> and <cite>[incoming_mail]</cite> to configure the
default values respectively for SMTP servers and the IMAP/POP servers.</p>
<p>Then for each server, you can define additional values or override the
default values with a section named <cite>[outgoing_mail.resource_name]</cite> or
<cite>[incoming_mail.resource_name]</cite> where “resource_name” is the name of
the server.</p>
<p>Example of config file</p>
<pre class="literal-block">
[outgoing_mail]
smtp_host = smtp.myserver.com
smtp_port = 587
smtp_user =
smtp_pass =
smtp_encryption = ssl
[outgoing_mail.odoo_smtp_server1]
smtp_user = odoo
smtp_pass = odoo
[incoming_mail.odoo_pop_mail1]
server = mail.myserver.com
port = 110
server_type = pop
is_ssl = 0
attach = 0
original = 0
user = odoo&#64;myserver.com
password = uas1ohV0
</pre>
<p>You will need to create 2 records in the database, one outgoing mail
server with the field <cite>name</cite> set to “odoo_smtp_server1” and one
incoming mail server with the field <cite>name</cite> set to “odoo_pop_mail1”.</p>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#toc-entry-3">Usage</a></h1>
<p>Once configured, Odoo will read the mail servers values from the
configuration file related to each environment defined in the main
Odoo file.</p>
</div>
<div class="section" id="known-issues-roadmap">
<h1><a class="toc-backref" href="#toc-entry-4">Known issues / Roadmap</a></h1>
<ul class="simple">
<li>Due to the special nature of this addon, you cannot test it on the OCA
runbot.</li>
</ul>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-5">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/server-env/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/server-env/issues/new?body=module:%20mail_environment%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#toc-entry-6">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#toc-entry-7">Authors</a></h2>
<ul class="simple">
<li>Camptocamp</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-8">Contributors</a></h2>
<ul class="simple">
<li>Nicolas Bessi &lt;<a class="reference external" href="mailto:nicolas.bessi&#64;camptocamp.com">nicolas.bessi&#64;camptocamp.com</a>&gt;</li>
<li>Yannick Vaucher &lt;<a class="reference external" href="mailto:yannick.vaucher&#64;camptocamp.com">yannick.vaucher&#64;camptocamp.com</a>&gt;</li>
<li>Guewen Baconnier &lt;<a class="reference external" href="mailto:guewen.baconnier&#64;camptocamp.com">guewen.baconnier&#64;camptocamp.com</a>&gt;</li>
<li>Joël Grand-Guillaume &lt;<a class="reference external" href="mailto:joel.grandguillaume&#64;camptocamp.com">joel.grandguillaume&#64;camptocamp.com</a>&gt;</li>
<li>Holger Brunn &lt;<a class="reference external" href="mailto:hbrunn&#64;therp.nl">hbrunn&#64;therp.nl</a>&gt;</li>
<li>Alexandre Fayolle &lt;<a class="reference external" href="mailto:alexandre.fayolle&#64;camptocamp.com">alexandre.fayolle&#64;camptocamp.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-9">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-env/tree/16.0/mail_environment">OCA/server-env</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
</div>
</body>
</html>

View File

@ -1 +0,0 @@
from . import test_mail_environment

View File

@ -1,77 +0,0 @@
# Copyright 2018 Camptocamp (https://www.camptocamp.com).
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
from odoo.addons.server_environment.tests.common import ServerEnvironmentCase
fetchmail_config = """
[incoming_mail.fetchmail1]
server = safe_server
port = 993
server_type = imap
is_ssl = 1
attach = 1
original = 1
user = admin
password = admin
state = done
priority = 1
active = 1
[incoming_mail.fetchmail2]
server = unsafe_server
port = 143
server_type = imap
is_ssl = 0
attach = 1
original = 1
user = admin
password = admin
state = done
priority = 1
active = 1
"""
class TestMailEnvironment(ServerEnvironmentCase):
def test_fetchmail_search_is_ssl(self):
fetchmail1 = self.env["fetchmail.server"].create({"name": "fetchmail1"})
fetchmail2 = self.env["fetchmail.server"].create({"name": "fetchmail2"})
with self.load_config(public=fetchmail_config):
# Test basic properties
self.assertTrue(fetchmail1.is_ssl)
self.assertEqual(fetchmail1.port, 993)
self.assertFalse(fetchmail2.is_ssl)
self.assertEqual(fetchmail2.port, 143)
# Test is_ssl search method
self.assertIn(
fetchmail1, self.env["fetchmail.server"].search([("is_ssl", "=", True)])
)
self.assertIn(
fetchmail1,
self.env["fetchmail.server"].search([("is_ssl", "!=", False)]),
)
self.assertNotIn(
fetchmail1,
self.env["fetchmail.server"].search([("is_ssl", "=", False)]),
)
self.assertNotIn(
fetchmail1,
self.env["fetchmail.server"].search([("is_ssl", "!=", True)]),
)
self.assertNotIn(
fetchmail2, self.env["fetchmail.server"].search([("is_ssl", "=", True)])
)
self.assertNotIn(
fetchmail2,
self.env["fetchmail.server"].search([("is_ssl", "!=", False)]),
)
self.assertIn(
fetchmail2,
self.env["fetchmail.server"].search([("is_ssl", "=", False)]),
)
self.assertIn(
fetchmail2,
self.env["fetchmail.server"].search([("is_ssl", "!=", True)]),
)

View File

@ -1,2 +0,0 @@
# generated from manifests external_dependencies
cryptography

View File

@ -7,7 +7,7 @@ server configuration environment files
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:681af9ccb320ef4e5866b4dfcb9ed2d8d19abae84f71d251cdc8376303f40c01
!! source digest: sha256:d9ca614a511f38fa74f55332b9672f1959fa46018462106b58f293eeed487269
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
@ -17,31 +17,31 @@ server configuration environment files
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--env-lightgray.png?logo=github
:target: https://github.com/OCA/server-env/tree/16.0/server_environment
:target: https://github.com/OCA/server-env/tree/17.0/server_environment
: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-16-0/server-env-16-0-server_environment
:target: https://translation.odoo-community.org/projects/server-env-17-0/server-env-17-0-server_environment
: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=16.0
: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 provides a way to define an environment in the main Odoo
configuration file and to read some configurations from files
depending on the configured environment: you define the environment in
the main configuration file, and the values for the various possible
environments are stored in the ``server_environment_files`` companion
module.
configuration file and to read some configurations from files depending
on the configured environment: you define the environment in the main
configuration file, and the values for the various possible environments
are stored in the ``server_environment_files`` companion module.
The ``server_environment_files`` module is optional, the values can be set using
an environment variable with a fallback on default values in the database.
The ``server_environment_files`` module is optional, the values can be
set using an environment variable with a fallback on default values in
the database.
The configuration read from the files are visible under the Configuration
menu. If you are not in the 'dev' environment you will not be able to
see the values contained in the defined secret keys
(by default : '*passw*', '*key*', '*secret*' and '*token*').
The configuration read from the files are visible under the
Configuration menu. If you are not in the 'dev' environment you will not
be able to see the values contained in the defined secret keys (by
default : '*passw*', '*key*', '*secret*' and '*token*').
**Table of contents**
@ -52,104 +52,112 @@ Installation
============
By itself, this module does little. See for instance the
``mail_environment`` addon which depends on this one to allow configuring
the incoming and outgoing mail servers depending on the environment.
``mail_environment`` addon which depends on this one to allow
configuring the incoming and outgoing mail servers depending on the
environment.
You can store your configuration values in a companion module called
``server_environment_files``. You can copy and customize the provided
``server_environment_files_sample`` module for this purpose. Alternatively, you
can provide them in environment variables ``SERVER_ENV_CONFIG`` and
``SERVER_ENV_CONFIG_SECRET``.
``server_environment_files_sample`` module for this purpose.
Alternatively, you can provide them in environment variables
``SERVER_ENV_CONFIG`` and ``SERVER_ENV_CONFIG_SECRET``.
Configuration
=============
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'::
used values are 'dev', 'test', 'production':
[options]
running_env=dev
::
Values associated to keys containing 'passw' are only displayed in the 'dev'
environment.
[options]
running_env=dev
If you don't provide any value, `test` is used as a safe default.
Values associated to keys containing 'passw' are only displayed in the
'dev' environment.
If you don't provide any value, test is used as a safe default.
You have several possibilities to set configuration values:
server_environment_files
~~~~~~~~~~~~~~~~~~~~~~~~
------------------------
You can edit the settings you need in the ``server_environment_files`` addon. The
``server_environment_files_sample`` can be used as an example:
You can edit the settings you need in the ``server_environment_files``
addon. The ``server_environment_files_sample`` can be used as an
example:
* values common to all / most environments can be stored in the
``default/`` directory using the .ini file syntax;
* each environment you need to define is stored in its own directory
and can override or extend default values;
* you can override or extend values in the main configuration
file of your instance;
- values common to all / most environments can be stored in the
``default/`` directory using the .ini file syntax;
- each environment you need to define is stored in its own directory
and can override or extend default values;
- you can override or extend values in the main configuration file of
your instance;
Environment variable
~~~~~~~~~~~~~~~~~~~~
--------------------
You can define configuration in the environment variable ``SERVER_ENV_CONFIG``
and/or ``SERVER_ENV_CONFIG_SECRET``. The 2 variables are handled the exact same
way, this is only a convenience for the deployment where you can isolate the
secrets in a different, encrypted, file. They are multi-line environment variables
in the same configparser format than the files.
If you used options in ``server_environment_files``, the options set in the
environment variable override them.
You can define configuration in the environment variable
``SERVER_ENV_CONFIG`` and/or ``SERVER_ENV_CONFIG_SECRET``. The 2
variables are handled the exact same way, this is only a convenience for
the deployment where you can isolate the secrets in a different,
encrypted, file. They are multi-line environment variables in the same
configparser format than the files. If you used options in
``server_environment_files``, the options set in the environment
variable override them.
The options in the environment variable are not dependent of ``running_env``,
the content of the variable must be set accordingly to the running environment.
The options in the environment variable are not dependent of
``running_env``, the content of the variable must be set accordingly to
the running environment.
Example of setup:
A public file, containing that will contain public variables::
A public file, containing that will contain public variables:
# These variables are not odoo standard variables,
# they are there to represent what your file could look like
export WORKERS='8'
export MAX_CRON_THREADS='1'
export LOG_LEVEL=info
export LOG_HANDLER=":INFO"
export DB_MAXCONN=5
::
# server environment options
export SERVER_ENV_CONFIG="
[storage_backend.my_sftp]
sftp_server=10.10.10.10
sftp_login=foo
sftp_port=22200
directory_path=Odoo
"
# These variables are not odoo standard variables,
# they are there to represent what your file could look like
export WORKERS='8'
export MAX_CRON_THREADS='1'
export LOG_LEVEL=info
export LOG_HANDLER=":INFO"
export DB_MAXCONN=5
A second file which is encrypted and contains secrets::
# server environment options
export SERVER_ENV_CONFIG="
[storage_backend.my_sftp]
sftp_server=10.10.10.10
sftp_login=foo
sftp_port=22200
directory_path=Odoo
"
# This variable is not an odoo standard variable,
# it is there to represent what your file could look like
export DB_PASSWORD='xxxxxxxxx'
# server environment options
export SERVER_ENV_CONFIG_SECRET="
[storage_backend.my_sftp]
sftp_password=xxxxxxxxx
"
A second file which is encrypted and contains secrets:
::
# This variable is not an odoo standard variable,
# it is there to represent what your file could look like
export DB_PASSWORD='xxxxxxxxx'
# server environment options
export SERVER_ENV_CONFIG_SECRET="
[storage_backend.my_sftp]
sftp_password=xxxxxxxxx
"
**WARNING**
`my_sftp` must match the name of the record.
If you want something more reliable use `server.env.techname.mixin`
and use `tech_name` field to reference records.
See "USAGE".
my_sftp must match the name of the record. If you want something more
reliable use server.env.techname.mixin and use tech_name field to
reference records. See "USAGE".
Default values
~~~~~~~~~~~~~~
--------------
When using the ``server.env.mixin`` mixin, for each env-computed field, a
companion field ``<field>_env_default`` is created. This field is not
When using the ``server.env.mixin`` mixin, for each env-computed field,
a companion field ``<field>_env_default`` is created. This field is not
environment-dependent. It's a fallback value used when no key is set in
configuration files / environment variable.
@ -157,49 +165,51 @@ When the default field is used, the field is made editable on Odoo.
Note: empty environment keys always take precedence over default fields
Server environment integration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------
Read the documentation of the class `models/server_env_mixin.py
<models/server_env_mixin.py>`_.
Read the documentation of the class
`models/server_env_mixin.py <models/server_env_mixin.py>`__.
Usage
=====
You can include a mixin in your model and configure the env-computed fields
by an override of ``_server_env_fields``.
You can include a mixin in your model and configure the env-computed
fields by an override of ``_server_env_fields``.
::
class StorageBackend(models.Model):
_name = "storage.backend"
_inherit = ["storage.backend", "server.env.mixin"]
class StorageBackend(models.Model):
_name = "storage.backend"
_inherit = ["storage.backend", "server.env.mixin"]
@property
def _server_env_fields(self):
return {"directory_path": {}}
@property
def _server_env_fields(self):
return {"directory_path": {}}
Read the documentation of the class and methods in `models/server_env_mixin.py
<models/server_env_mixin.py>`__.
Read the documentation of the class and methods in
`models/server_env_mixin.py <models/server_env_mixin.py>`__.
If you want to have a technical name to reference:
If you want to have a technical name to reference::
::
class StorageBackend(models.Model):
_name = "storage.backend"
_inherit = ["storage.backend", "server.env.techname.mixin", "server.env.mixin"]
class StorageBackend(models.Model):
_name = "storage.backend"
_inherit = ["storage.backend", "server.env.techname.mixin", "server.env.mixin"]
[...]
[...]
Known issues / Roadmap
======================
* it is not possible to set the environment from the command line. A
configuration file must be used.
* the module does not allow to set low level attributes such as database server, etc.
* `server.env.techname.mixin`'s `tech_name` field could leverage the new option
for computable / writable fields and get rid of some onchange / read / write code.
- it is not possible to set the environment from the command line. A
configuration file must be used.
- the module does not allow to set low level attributes such as
database server, etc.
- server.env.techname.mixin's tech_name field could leverage the new
option for computable / writable fields and get rid of some onchange
/ read / write code.
Bug Tracker
===========
@ -207,7 +217,7 @@ 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%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/server-env/issues/new?body=module:%20server_environment%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.
@ -215,28 +225,28 @@ Credits
=======
Authors
~~~~~~~
-------
* Camptocamp
Contributors
~~~~~~~~~~~~
------------
* Florent Xicluna (Wingo) <florent.xicluna@gmail.com>
* Nicolas Bessi <nicolas.bessi@camptocamp.com>
* Alexandre Fayolle <alexandre.fayolle@camptocamp.com>
* Daniel Reis <dgreis@sapo.pt>
* Holger Brunn <hbrunn@therp.nl>
* Leonardo Pistone <leonardo.pistone@camptocamp.com>
* Adrien Peiffer <adrien.peiffer@acsone.com>
* Thierry Ducrest <thierry.ducrest@camptocamp.com>
* Guewen Baconnier <guewen.baconnier@camptocamp.com>
* Thomas Binfeld <thomas.binsfeld@acsone.eu>
* Stéphane Bidoul <stefane.bidoul@acsone.com>
* Simone Orsi <simahawk@gmail.com>
- Florent Xicluna (Wingo) <florent.xicluna@gmail.com>
- Nicolas Bessi <nicolas.bessi@camptocamp.com>
- Alexandre Fayolle <alexandre.fayolle@camptocamp.com>
- Daniel Reis <dgreis@sapo.pt>
- Holger Brunn <hbrunn@therp.nl>
- Leonardo Pistone <leonardo.pistone@camptocamp.com>
- Adrien Peiffer <adrien.peiffer@acsone.com>
- Thierry Ducrest <thierry.ducrest@camptocamp.com>
- Guewen Baconnier <guewen.baconnier@camptocamp.com>
- Thomas Binfeld <thomas.binsfeld@acsone.eu>
- Stéphane Bidoul <stefane.bidoul@acsone.com>
- Simone Orsi <simahawk@gmail.com>
Maintainers
~~~~~~~~~~~
-----------
This module is maintained by the OCA.
@ -248,6 +258,6 @@ 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.
This module is part of the `OCA/server-env <https://github.com/OCA/server-env/tree/16.0/server_environment>`_ project on GitHub.
This module is part of the `OCA/server-env <https://github.com/OCA/server-env/tree/17.0/server_environment>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@ -4,7 +4,7 @@
{
"name": "server configuration environment files",
"version": "16.0.1.0.3",
"version": "17.0.1.0.0",
"depends": ["base", "base_sparse_field"],
"author": "Camptocamp,Odoo Community Association (OCA)",
"summary": "move some configurations out of the database",

View File

@ -8,8 +8,8 @@ msgstr ""
"Project-Id-Version: server-tools (9.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-09-10 02:53+0000\n"
"PO-Revision-Date: 2024-01-04 10:35+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
"PO-Revision-Date: 2023-06-26 11:10+0000\n"
"Last-Translator: Francesco Foresti <francesco.foresti@ooops404.com>\n"
"Language-Team: Italian (http://www.transifex.com/oca/OCA-server-tools-9-0/"
"language/it/)\n"
"Language: it\n"
@ -22,7 +22,7 @@ msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__config
msgid "Config"
msgstr "Configurazione"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__create_uid
@ -42,7 +42,7 @@ msgstr "Nome visualizzato"
#. module: server_environment
#: model:ir.model,name:server_environment.model_server_config
msgid "Display server configuration"
msgstr "Visualizza configurazione server"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__id
@ -67,490 +67,490 @@ msgstr "Ultimo aggiornamento il"
#. module: server_environment
#: model:ir.model,name:server_environment.model_server_env_mixin
msgid "Mixin to add server environment in existing models"
msgstr "Mixin per aggiungere l'ambiente server in modelli esistenti"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_env_mixin__server_env_defaults
msgid "Server Env Defaults"
msgstr "Server ambiente predefinito"
msgstr ""
#. module: server_environment
#: model:ir.actions.act_window,name:server_environment.server_env_act_show_config
#: model:ir.ui.menu,name:server_environment.menu_server_show_config
msgid "Server Environment"
msgstr "Ambiente server"
msgstr ""
#. module: server_environment
#: model:ir.model,name:server_environment.model_server_env_techname_mixin
msgid "Server environment technical name"
msgstr "Nome tecnico ambiente server"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_env_techname_mixin__tech_name
msgid "Tech Name"
msgstr "Nome tecnico"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,help:server_environment.field_server_env_techname_mixin__tech_name
msgid "Unique name for technical purposes. Eg: server env keys."
msgstr "Nome univoco per motivi tecnici. Es: chiavi server ambiente."
msgstr ""
#. module: server_environment
#: model:res.groups,name:server_environment.has_server_configuration_access
msgid "View Server Environment Configuration"
msgstr "Visualizza configurazione ambiente server"
msgstr ""
#. module: server_environment
#: model:ir.model.constraint,message:server_environment.constraint_server_env_techname_mixin_tech_name_uniq
msgid "`tech_name` must be unique!"
msgstr "`tech_name` deve essere univoco!"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_addons_path
msgid "odoo | addons_path"
msgstr "odoo | addons_path"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_admin_passwd
msgid "odoo | admin_passwd"
msgstr "odoo | admin_passwd"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_config
msgid "odoo | config"
msgstr "odoo | config"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_csv_internal_sep
msgid "odoo | csv_internal_sep"
msgstr "odoo | csv_internal_sep"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_data_dir
msgid "odoo | data_dir"
msgstr "odoo | data_dir"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_db_host
msgid "odoo | db_host"
msgstr "odoo | db_host"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_db_maxconn
msgid "odoo | db_maxconn"
msgstr "odoo | db_maxconn"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_db_name
msgid "odoo | db_name"
msgstr "odoo | db_name"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_db_password
msgid "odoo | db_password"
msgstr "odoo | db_password"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_db_port
msgid "odoo | db_port"
msgstr "odoo | db_port"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_db_sslmode
msgid "odoo | db_sslmode"
msgstr "odoo | db_sslmode"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_db_template
msgid "odoo | db_template"
msgstr "odoo | db_template"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_db_user
msgid "odoo | db_user"
msgstr "odoo | db_user"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_dbfilter
msgid "odoo | dbfilter"
msgstr "odoo | dbfilter"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_demo
msgid "odoo | demo"
msgstr "odoo | demo"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_dev_mode
msgid "odoo | dev_mode"
msgstr "odoo | dev_mode"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_email_from
msgid "odoo | email_from"
msgstr "odoo | email_from"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_from_filter
msgid "odoo | from_filter"
msgstr "odoo | from_filter"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_geoip_database
msgid "odoo | geoip_database"
msgstr "odoo | geoip_database"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_gevent_port
msgid "odoo | gevent_port"
msgstr "odoo | gevent_port"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_http_enable
msgid "odoo | http_enable"
msgstr "odoo | http_enable"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_http_interface
msgid "odoo | http_interface"
msgstr "odoo | http_interface"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_http_port
msgid "odoo | http_port"
msgstr "odoo | http_port"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_import_partial
msgid "odoo | import_partial"
msgstr "odoo | import_partial"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_init
msgid "odoo | init"
msgstr "odoo | init"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_language
msgid "odoo | language"
msgstr "odoo | language"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_limit_memory_hard
msgid "odoo | limit_memory_hard"
msgstr "odoo | limit_memory_hard"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_limit_memory_soft
msgid "odoo | limit_memory_soft"
msgstr "odoo | limit_memory_soft"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_limit_request
msgid "odoo | limit_request"
msgstr "odoo | limit_request"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_limit_time_cpu
msgid "odoo | limit_time_cpu"
msgstr "odoo | limit_time_cpu"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_limit_time_real
msgid "odoo | limit_time_real"
msgstr "odoo | limit_time_real"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_limit_time_real_cron
msgid "odoo | limit_time_real_cron"
msgstr "odoo | limit_time_real_cron"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_list_db
msgid "odoo | list_db"
msgstr "odoo | list_db"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_log_db
msgid "odoo | log_db"
msgstr "odoo | log_db"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_log_db_level
msgid "odoo | log_db_level"
msgstr "odoo | log_db_level"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_log_handler
msgid "odoo | log_handler"
msgstr "odoo | log_handler"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_log_level
msgid "odoo | log_level"
msgstr "odoo | log_level"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_logfile
msgid "odoo | logfile"
msgstr "odoo | logfile"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_longpolling_port
msgid "odoo | longpolling_port"
msgstr "odoo | longpolling_port"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_max_cron_threads
msgid "odoo | max_cron_threads"
msgstr "odoo | max_cron_threads"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_osv_memory_age_limit
msgid "odoo | osv_memory_age_limit"
msgstr "odoo | osv_memory_age_limit"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_osv_memory_count_limit
msgid "odoo | osv_memory_count_limit"
msgstr "odoo | osv_memory_count_limit"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_overwrite_existing_translations
msgid "odoo | overwrite_existing_translations"
msgstr "odoo | overwrite_existing_translations"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_pg_path
msgid "odoo | pg_path"
msgstr "odoo | pg_path"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_pidfile
msgid "odoo | pidfile"
msgstr "odoo | pidfile"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_proxy_mode
msgid "odoo | proxy_mode"
msgstr "odoo | proxy_mode"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_publisher_warranty_url
msgid "odoo | publisher_warranty_url"
msgstr "odoo | publisher_warranty_url"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_reportgz
msgid "odoo | reportgz"
msgstr "odoo | reportgz"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_root_path
msgid "odoo | root_path"
msgstr "odoo | root_path"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_running_env
msgid "odoo | running_env"
msgstr "odoo | running_env"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_save
msgid "odoo | save"
msgstr "odoo | save"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_screencasts
msgid "odoo | screencasts"
msgstr "odoo | screencasts"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_screenshots
msgid "odoo | screenshots"
msgstr "odoo | screenshots"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_server_wide_modules
msgid "odoo | server_wide_modules"
msgstr "odoo | server_wide_modules"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_shell_interface
msgid "odoo | shell_interface"
msgstr "odoo | shell_interface"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_smtp_password
msgid "odoo | smtp_password"
msgstr "odoo | smtp_password"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_smtp_port
msgid "odoo | smtp_port"
msgstr "odoo | smtp_port"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_smtp_server
msgid "odoo | smtp_server"
msgstr "odoo | smtp_server"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_smtp_ssl
msgid "odoo | smtp_ssl"
msgstr "odoo | smtp_ssl"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_smtp_ssl_certificate_filename
msgid "odoo | smtp_ssl_certificate_filename"
msgstr "odoo | smtp_ssl_certificate_filename"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_smtp_ssl_private_key_filename
msgid "odoo | smtp_ssl_private_key_filename"
msgstr "odoo | smtp_ssl_private_key_filename"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_smtp_user
msgid "odoo | smtp_user"
msgstr "odoo | smtp_user"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_stop_after_init
msgid "odoo | stop_after_init"
msgstr "odoo | stop_after_init"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_syslog
msgid "odoo | syslog"
msgstr "odoo | syslog"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_test_enable
msgid "odoo | test_enable"
msgstr "odoo | test_enable"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_test_file
msgid "odoo | test_file"
msgstr "odoo | test_file"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_test_tags
msgid "odoo | test_tags"
msgstr "odoo | test_tags"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_transient_age_limit
msgid "odoo | transient_age_limit"
msgstr "odoo | transient_age_limit"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_translate_in
msgid "odoo | translate_in"
msgstr "odoo | translate_in"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_translate_modules
msgid "odoo | translate_modules"
msgstr "odoo | translate_modules"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_translate_out
msgid "odoo | translate_out"
msgstr "odoo | translate_out"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_unaccent
msgid "odoo | unaccent"
msgstr "odoo | unaccent"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_update
msgid "odoo | update"
msgstr "odoo | update"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_upgrade_path
msgid "odoo | upgrade_path"
msgstr "odoo | upgrade_path"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_websocket_keep_alive_timeout
msgid "odoo | websocket_keep_alive_timeout"
msgstr "odoo | websocket_keep_alive_timeout"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_websocket_rate_limit_burst
msgid "odoo | websocket_rate_limit_burst"
msgstr "odoo | websocket_rate_limit_burst"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_websocket_rate_limit_delay
msgid "odoo | websocket_rate_limit_delay"
msgstr "odoo | websocket_rate_limit_delay"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_without_demo
msgid "odoo | without_demo"
msgstr "odoo | without_demo"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_workers
msgid "odoo | workers"
msgstr "odoo | workers"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_x_sendfile
msgid "odoo | x_sendfile"
msgstr "odoo | x_sendfile"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__system_I_architecture
msgid "system | architecture"
msgstr "system | architecture"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__system_I_locale
msgid "system | locale"
msgstr "system | locale"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__system_I_lsb_release
msgid "system | lsb_release"
msgstr "system | lsb_release"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__system_I_odoo
msgid "system | odoo"
msgstr "system | odoo"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__system_I_os_name
msgid "system | os_name"
msgstr "system | os_name"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__system_I_platform
msgid "system | platform"
msgstr "system | platform"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__system_I_python
msgid "system | python"
msgstr "system | python"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__system_I_release
msgid "system | release"
msgstr "system | release"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__system_I_revision
msgid "system | revision"
msgstr "system | revision"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__system_I_version
msgid "system | version"
msgstr "system | version"
msgstr ""

View File

@ -4,7 +4,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -43,11 +43,6 @@ msgstr ""
msgid "ID"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config____last_update
msgid "Last Modified on"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__write_uid
msgid "Last Updated by"
@ -134,6 +129,11 @@ msgstr ""
msgid "odoo | db_maxconn"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_db_maxconn_gevent
msgid "odoo | db_maxconn_gevent"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_db_name
msgid "odoo | db_name"
@ -190,8 +190,13 @@ msgid "odoo | from_filter"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_geoip_database
msgid "odoo | geoip_database"
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_geoip_city_db
msgid "odoo | geoip_city_db"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_geoip_country_db
msgid "odoo | geoip_country_db"
msgstr ""
#. module: server_environment
@ -299,11 +304,6 @@ msgstr ""
msgid "odoo | max_cron_threads"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_osv_memory_age_limit
msgid "odoo | osv_memory_age_limit"
msgstr ""
#. module: server_environment
#: model:ir.model.fields,field_description:server_environment.field_server_config__odoo_I_osv_memory_count_limit
msgid "odoo | osv_memory_count_limit"

View File

@ -313,7 +313,7 @@ class ServerEnvMixin(models.AbstractModel):
for elem in view_arch.findall(field_xpath % field):
# set env-computed fields to readonly if the configuration
# files have a key set for this field
elem.set("attrs", str({"readonly": [(is_editable_field, "=", False)]}))
elem.set("readonly", "not is_editable_field")
if not view_arch.findall(field_xpath % is_editable_field):
# add the _is_editable fields in the view for the 'attrs'
# domain
@ -338,7 +338,7 @@ class ServerEnvMixin(models.AbstractModel):
options = self._server_env_fields[base_field_name]
if options and options.get("no_default_field"):
return ""
return "{}_env_default".format(base_field_name)
return f"x_{base_field_name}_env_default"
def _server_env_is_editable_fieldname(self, base_field_name):
"""Return the name of the field for "is editable"
@ -346,7 +346,7 @@ class ServerEnvMixin(models.AbstractModel):
This is the field used to tell if the env-computed field can
be edited.
"""
return "{}_env_is_editable".format(base_field_name)
return f"x_{base_field_name}_env_is_editable"
def _server_env_transform_field_to_read_from_env(self, field):
"""Transform the original field in a computed field"""

View File

@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"

View File

@ -0,0 +1,94 @@
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
Values associated to keys containing 'passw' are only displayed in the
'dev' environment.
If you don't provide any value, test is used as a safe default.
You have several possibilities to set configuration values:
## server_environment_files
You can edit the settings you need in the `server_environment_files`
addon. The `server_environment_files_sample` can be used as an example:
- values common to all / most environments can be stored in the
`default/` directory using the .ini file syntax;
- each environment you need to define is stored in its own directory and
can override or extend default values;
- you can override or extend values in the main configuration file of
your instance;
## Environment variable
You can define configuration in the environment variable
`SERVER_ENV_CONFIG` and/or `SERVER_ENV_CONFIG_SECRET`. The 2 variables
are handled the exact same way, this is only a convenience for the
deployment where you can isolate the secrets in a different, encrypted,
file. They are multi-line environment variables in the same configparser
format than the files. If you used options in
`server_environment_files`, the options set in the environment variable
override them.
The options in the environment variable are not dependent of
`running_env`, the content of the variable must be set accordingly to
the running environment.
Example of setup:
A public file, containing that will contain public variables:
# These variables are not odoo standard variables,
# they are there to represent what your file could look like
export WORKERS='8'
export MAX_CRON_THREADS='1'
export LOG_LEVEL=info
export LOG_HANDLER=":INFO"
export DB_MAXCONN=5
# server environment options
export SERVER_ENV_CONFIG="
[storage_backend.my_sftp]
sftp_server=10.10.10.10
sftp_login=foo
sftp_port=22200
directory_path=Odoo
"
A second file which is encrypted and contains secrets:
# This variable is not an odoo standard variable,
# it is there to represent what your file could look like
export DB_PASSWORD='xxxxxxxxx'
# server environment options
export SERVER_ENV_CONFIG_SECRET="
[storage_backend.my_sftp]
sftp_password=xxxxxxxxx
"
**WARNING**
> my_sftp must match the name of the record. If you want something more
> reliable use server.env.techname.mixin and use tech_name field to
> reference records. See "USAGE".
## Default values
When using the `server.env.mixin` mixin, for each env-computed field, a
companion field `<field>_env_default` is created. This field is not
environment-dependent. It's a fallback value used when no key is set in
configuration files / environment variable.
When the default field is used, the field is made editable on Odoo.
Note: empty environment keys always take precedence over default fields
## Server environment integration
Read the documentation of the class
[models/server_env_mixin.py](models/server_env_mixin.py).

View File

@ -1,99 +0,0 @@
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
Values associated to keys containing 'passw' are only displayed in the 'dev'
environment.
If you don't provide any value, `test` is used as a safe default.
You have several possibilities to set configuration values:
server_environment_files
~~~~~~~~~~~~~~~~~~~~~~~~
You can edit the settings you need in the ``server_environment_files`` addon. The
``server_environment_files_sample`` can be used as an example:
* values common to all / most environments can be stored in the
``default/`` directory using the .ini file syntax;
* each environment you need to define is stored in its own directory
and can override or extend default values;
* you can override or extend values in the main configuration
file of your instance;
Environment variable
~~~~~~~~~~~~~~~~~~~~
You can define configuration in the environment variable ``SERVER_ENV_CONFIG``
and/or ``SERVER_ENV_CONFIG_SECRET``. The 2 variables are handled the exact same
way, this is only a convenience for the deployment where you can isolate the
secrets in a different, encrypted, file. They are multi-line environment variables
in the same configparser format than the files.
If you used options in ``server_environment_files``, the options set in the
environment variable override them.
The options in the environment variable are not dependent of ``running_env``,
the content of the variable must be set accordingly to the running environment.
Example of setup:
A public file, containing that will contain public variables::
# These variables are not odoo standard variables,
# they are there to represent what your file could look like
export WORKERS='8'
export MAX_CRON_THREADS='1'
export LOG_LEVEL=info
export LOG_HANDLER=":INFO"
export DB_MAXCONN=5
# server environment options
export SERVER_ENV_CONFIG="
[storage_backend.my_sftp]
sftp_server=10.10.10.10
sftp_login=foo
sftp_port=22200
directory_path=Odoo
"
A second file which is encrypted and contains secrets::
# This variable is not an odoo standard variable,
# it is there to represent what your file could look like
export DB_PASSWORD='xxxxxxxxx'
# server environment options
export SERVER_ENV_CONFIG_SECRET="
[storage_backend.my_sftp]
sftp_password=xxxxxxxxx
"
**WARNING**
`my_sftp` must match the name of the record.
If you want something more reliable use `server.env.techname.mixin`
and use `tech_name` field to reference records.
See "USAGE".
Default values
~~~~~~~~~~~~~~
When using the ``server.env.mixin`` mixin, for each env-computed field, a
companion field ``<field>_env_default`` is created. This field is not
environment-dependent. It's a fallback value used when no key is set in
configuration files / environment variable.
When the default field is used, the field is made editable on Odoo.
Note: empty environment keys always take precedence over default fields
Server environment integration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Read the documentation of the class `models/server_env_mixin.py
<models/server_env_mixin.py>`_.

View File

@ -0,0 +1,12 @@
- Florent Xicluna (Wingo) \<<florent.xicluna@gmail.com>\>
- Nicolas Bessi \<<nicolas.bessi@camptocamp.com>\>
- Alexandre Fayolle \<<alexandre.fayolle@camptocamp.com>\>
- Daniel Reis \<<dgreis@sapo.pt>\>
- Holger Brunn \<<hbrunn@therp.nl>\>
- Leonardo Pistone \<<leonardo.pistone@camptocamp.com>\>
- Adrien Peiffer \<<adrien.peiffer@acsone.com>\>
- Thierry Ducrest \<<thierry.ducrest@camptocamp.com>\>
- Guewen Baconnier \<<guewen.baconnier@camptocamp.com>\>
- Thomas Binfeld \<<thomas.binsfeld@acsone.eu>\>
- Stéphane Bidoul \<<stefane.bidoul@acsone.com>\>
- Simone Orsi \<<simahawk@gmail.com>\>

View File

@ -1,12 +0,0 @@
* Florent Xicluna (Wingo) <florent.xicluna@gmail.com>
* Nicolas Bessi <nicolas.bessi@camptocamp.com>
* Alexandre Fayolle <alexandre.fayolle@camptocamp.com>
* Daniel Reis <dgreis@sapo.pt>
* Holger Brunn <hbrunn@therp.nl>
* Leonardo Pistone <leonardo.pistone@camptocamp.com>
* Adrien Peiffer <adrien.peiffer@acsone.com>
* Thierry Ducrest <thierry.ducrest@camptocamp.com>
* Guewen Baconnier <guewen.baconnier@camptocamp.com>
* Thomas Binfeld <thomas.binsfeld@acsone.eu>
* Stéphane Bidoul <stefane.bidoul@acsone.com>
* Simone Orsi <simahawk@gmail.com>

View File

@ -0,0 +1,14 @@
This module provides a way to define an environment in the main Odoo
configuration file and to read some configurations from files depending
on the configured environment: you define the environment in the main
configuration file, and the values for the various possible environments
are stored in the `server_environment_files` companion module.
The `server_environment_files` module is optional, the values can be set
using an environment variable with a fallback on default values in the
database.
The configuration read from the files are visible under the
Configuration menu. If you are not in the 'dev' environment you will not
be able to see the values contained in the defined secret keys (by
default : '*passw*', '*key*', '*secret*' and '*token*').

View File

@ -1,14 +0,0 @@
This module provides a way to define an environment in the main Odoo
configuration file and to read some configurations from files
depending on the configured environment: you define the environment in
the main configuration file, and the values for the various possible
environments are stored in the ``server_environment_files`` companion
module.
The ``server_environment_files`` module is optional, the values can be set using
an environment variable with a fallback on default values in the database.
The configuration read from the files are visible under the Configuration
menu. If you are not in the 'dev' environment you will not be able to
see the values contained in the defined secret keys
(by default : '*passw*', '*key*', '*secret*' and '*token*').

View File

@ -0,0 +1,9 @@
By itself, this module does little. See for instance the
`mail_environment` addon which depends on this one to allow configuring
the incoming and outgoing mail servers depending on the environment.
You can store your configuration values in a companion module called
`server_environment_files`. You can copy and customize the provided
`server_environment_files_sample` module for this purpose.
Alternatively, you can provide them in environment variables
`SERVER_ENV_CONFIG` and `SERVER_ENV_CONFIG_SECRET`.

View File

@ -1,9 +0,0 @@
By itself, this module does little. See for instance the
``mail_environment`` addon which depends on this one to allow configuring
the incoming and outgoing mail servers depending on the environment.
You can store your configuration values in a companion module called
``server_environment_files``. You can copy and customize the provided
``server_environment_files_sample`` module for this purpose. Alternatively, you
can provide them in environment variables ``SERVER_ENV_CONFIG`` and
``SERVER_ENV_CONFIG_SECRET``.

View File

@ -0,0 +1,7 @@
- it is not possible to set the environment from the command line. A
configuration file must be used.
- the module does not allow to set low level attributes such as database
server, etc.
- server.env.techname.mixin's tech_name field could leverage the new
option for computable / writable fields and get rid of some onchange /
read / write code.

View File

@ -1,5 +0,0 @@
* it is not possible to set the environment from the command line. A
configuration file must be used.
* the module does not allow to set low level attributes such as database server, etc.
* `server.env.techname.mixin`'s `tech_name` field could leverage the new option
for computable / writable fields and get rid of some onchange / read / write code.

View File

@ -1,7 +1,5 @@
You can include a mixin in your model and configure the env-computed fields
by an override of ``_server_env_fields``.
::
You can include a mixin in your model and configure the env-computed
fields by an override of `_server_env_fields`.
class StorageBackend(models.Model):
_name = "storage.backend"
@ -11,11 +9,10 @@ by an override of ``_server_env_fields``.
def _server_env_fields(self):
return {"directory_path": {}}
Read the documentation of the class and methods in `models/server_env_mixin.py
<models/server_env_mixin.py>`__.
Read the documentation of the class and methods in
[models/server_env_mixin.py](models/server_env_mixin.py).
If you want to have a technical name to reference::
If you want to have a technical name to reference:
class StorageBackend(models.Model):
_name = "storage.backend"

View File

@ -111,9 +111,7 @@ def _load_config_from_server_env_files(config_p):
try:
config_p.read(conf_files)
except Exception as e:
raise Exception(
'Cannot read config files "{}": {}'.format(conf_files, e)
) from e
raise Exception(f'Cannot read config files "{conf_files}": {e}') from e
def _load_config_from_rcfile(config_p):
@ -129,7 +127,7 @@ def _load_config_from_env(config_p):
config_p.read_string(env_config)
except configparser.Error as err:
raise Exception(
"{} content could not be parsed: {}".format(varname, err)
f"{varname} content could not be parsed: {err}"
) from err
@ -182,7 +180,7 @@ class ServerConfiguration(models.TransientModel):
@classmethod
def _format_key(cls, section, key):
return "{}_I_{}".format(section, key)
return f"{section}_I_{key}"
@property
def show_passwords(self):

View File

@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
@ -367,21 +366,21 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:681af9ccb320ef4e5866b4dfcb9ed2d8d19abae84f71d251cdc8376303f40c01
!! source digest: sha256:d9ca614a511f38fa74f55332b9672f1959fa46018462106b58f293eeed487269
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/server-env/tree/16.0/server_environment"><img alt="OCA/server-env" src="https://img.shields.io/badge/github-OCA%2Fserver--env-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/server-env-16-0/server-env-16-0-server_environment"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/server-env&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/server-env/tree/17.0/server_environment"><img alt="OCA/server-env" src="https://img.shields.io/badge/github-OCA%2Fserver--env-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/server-env-17-0/server-env-17-0-server_environment"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/server-env&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module provides a way to define an environment in the main Odoo
configuration file and to read some configurations from files
depending on the configured environment: you define the environment in
the main configuration file, and the values for the various possible
environments are stored in the <tt class="docutils literal">server_environment_files</tt> companion
module.</p>
<p>The <tt class="docutils literal">server_environment_files</tt> module is optional, the values can be set using
an environment variable with a fallback on default values in the database.</p>
<p>The configuration read from the files are visible under the Configuration
menu. If you are not in the dev environment you will not be able to
see the values contained in the defined secret keys
(by default : <em>passw</em>, <em>key</em>, <em>secret</em> and <em>token</em>).</p>
configuration file and to read some configurations from files depending
on the configured environment: you define the environment in the main
configuration file, and the values for the various possible environments
are stored in the <tt class="docutils literal">server_environment_files</tt> companion module.</p>
<p>The <tt class="docutils literal">server_environment_files</tt> module is optional, the values can be
set using an environment variable with a fallback on default values in
the database.</p>
<p>The configuration read from the files are visible under the
Configuration menu. If you are not in the dev environment you will not
be able to see the values contained in the defined secret keys (by
default : <em>passw</em>, <em>key</em>, <em>secret</em> and <em>token</em>).</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
@ -407,13 +406,14 @@ see the values contained in the defined secret keys
<div class="section" id="installation">
<h1><a class="toc-backref" href="#toc-entry-1">Installation</a></h1>
<p>By itself, this module does little. See for instance the
<tt class="docutils literal">mail_environment</tt> addon which depends on this one to allow configuring
the incoming and outgoing mail servers depending on the environment.</p>
<tt class="docutils literal">mail_environment</tt> addon which depends on this one to allow
configuring the incoming and outgoing mail servers depending on the
environment.</p>
<p>You can store your configuration values in a companion module called
<tt class="docutils literal">server_environment_files</tt>. You can copy and customize the provided
<tt class="docutils literal">server_environment_files_sample</tt> module for this purpose. Alternatively, you
can provide them in environment variables <tt class="docutils literal">SERVER_ENV_CONFIG</tt> and
<tt class="docutils literal">SERVER_ENV_CONFIG_SECRET</tt>.</p>
<tt class="docutils literal">server_environment_files_sample</tt> module for this purpose.
Alternatively, you can provide them in environment variables
<tt class="docutils literal">SERVER_ENV_CONFIG</tt> and <tt class="docutils literal">SERVER_ENV_CONFIG_SECRET</tt>.</p>
</div>
<div class="section" id="configuration">
<h1><a class="toc-backref" href="#toc-entry-2">Configuration</a></h1>
@ -424,34 +424,37 @@ used values are dev, test, production:</p>
[options]
running_env=dev
</pre>
<p>Values associated to keys containing passw are only displayed in the dev
environment.</p>
<p>If you dont provide any value, <cite>test</cite> is used as a safe default.</p>
<p>Values associated to keys containing passw are only displayed in the
dev environment.</p>
<p>If you dont provide any value, test is used as a safe default.</p>
<p>You have several possibilities to set configuration values:</p>
<div class="section" id="server-environment-files">
<h2><a class="toc-backref" href="#toc-entry-3">server_environment_files</a></h2>
<p>You can edit the settings you need in the <tt class="docutils literal">server_environment_files</tt> addon. The
<tt class="docutils literal">server_environment_files_sample</tt> can be used as an example:</p>
<p>You can edit the settings you need in the <tt class="docutils literal">server_environment_files</tt>
addon. The <tt class="docutils literal">server_environment_files_sample</tt> can be used as an
example:</p>
<ul class="simple">
<li>values common to all / most environments can be stored in the
<tt class="docutils literal">default/</tt> directory using the .ini file syntax;</li>
<li>each environment you need to define is stored in its own directory
and can override or extend default values;</li>
<li>you can override or extend values in the main configuration
file of your instance;</li>
<li>you can override or extend values in the main configuration file of
your instance;</li>
</ul>
</div>
<div class="section" id="environment-variable">
<h2><a class="toc-backref" href="#toc-entry-4">Environment variable</a></h2>
<p>You can define configuration in the environment variable <tt class="docutils literal">SERVER_ENV_CONFIG</tt>
and/or <tt class="docutils literal">SERVER_ENV_CONFIG_SECRET</tt>. The 2 variables are handled the exact same
way, this is only a convenience for the deployment where you can isolate the
secrets in a different, encrypted, file. They are multi-line environment variables
in the same configparser format than the files.
If you used options in <tt class="docutils literal">server_environment_files</tt>, the options set in the
environment variable override them.</p>
<p>The options in the environment variable are not dependent of <tt class="docutils literal">running_env</tt>,
the content of the variable must be set accordingly to the running environment.</p>
<p>You can define configuration in the environment variable
<tt class="docutils literal">SERVER_ENV_CONFIG</tt> and/or <tt class="docutils literal">SERVER_ENV_CONFIG_SECRET</tt>. The 2
variables are handled the exact same way, this is only a convenience for
the deployment where you can isolate the secrets in a different,
encrypted, file. They are multi-line environment variables in the same
configparser format than the files. If you used options in
<tt class="docutils literal">server_environment_files</tt>, the options set in the environment
variable override them.</p>
<p>The options in the environment variable are not dependent of
<tt class="docutils literal">running_env</tt>, the content of the variable must be set accordingly to
the running environment.</p>
<p>Example of setup:</p>
<p>A public file, containing that will contain public variables:</p>
<pre class="literal-block">
@ -485,15 +488,14 @@ sftp_password=xxxxxxxxx
</pre>
<p><strong>WARNING</strong></p>
<blockquote>
<cite>my_sftp</cite> must match the name of the record.
If you want something more reliable use <cite>server.env.techname.mixin</cite>
and use <cite>tech_name</cite> field to reference records.
See “USAGE”.</blockquote>
my_sftp must match the name of the record. If you want something more
reliable use server.env.techname.mixin and use tech_name field to
reference records. See “USAGE”.</blockquote>
</div>
<div class="section" id="default-values">
<h2><a class="toc-backref" href="#toc-entry-5">Default values</a></h2>
<p>When using the <tt class="docutils literal">server.env.mixin</tt> mixin, for each env-computed field, a
companion field <tt class="docutils literal">&lt;field&gt;_env_default</tt> is created. This field is not
<p>When using the <tt class="docutils literal">server.env.mixin</tt> mixin, for each env-computed field,
a companion field <tt class="docutils literal">&lt;field&gt;_env_default</tt> is created. This field is not
environment-dependent. Its a fallback value used when no key is set in
configuration files / environment variable.</p>
<p>When the default field is used, the field is made editable on Odoo.</p>
@ -501,13 +503,14 @@ configuration files / environment variable.</p>
</div>
<div class="section" id="server-environment-integration">
<h2><a class="toc-backref" href="#toc-entry-6">Server environment integration</a></h2>
<p>Read the documentation of the class <a class="reference external" href="models/server_env_mixin.py">models/server_env_mixin.py</a>.</p>
<p>Read the documentation of the class
<a class="reference external" href="models/server_env_mixin.py">models/server_env_mixin.py</a>.</p>
</div>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#toc-entry-7">Usage</a></h1>
<p>You can include a mixin in your model and configure the env-computed fields
by an override of <tt class="docutils literal">_server_env_fields</tt>.</p>
<p>You can include a mixin in your model and configure the env-computed
fields by an override of <tt class="docutils literal">_server_env_fields</tt>.</p>
<pre class="literal-block">
class StorageBackend(models.Model):
_name = &quot;storage.backend&quot;
@ -517,7 +520,8 @@ class StorageBackend(models.Model):
def _server_env_fields(self):
return {&quot;directory_path&quot;: {}}
</pre>
<p>Read the documentation of the class and methods in <a class="reference external" href="models/server_env_mixin.py">models/server_env_mixin.py</a>.</p>
<p>Read the documentation of the class and methods in
<a class="reference external" href="models/server_env_mixin.py">models/server_env_mixin.py</a>.</p>
<p>If you want to have a technical name to reference:</p>
<pre class="literal-block">
class StorageBackend(models.Model):
@ -532,9 +536,11 @@ class StorageBackend(models.Model):
<ul class="simple">
<li>it is not possible to set the environment from the command line. A
configuration file must be used.</li>
<li>the module does not allow to set low level attributes such as database server, etc.</li>
<li><cite>server.env.techname.mixin</cite>s <cite>tech_name</cite> field could leverage the new option
for computable / writable fields and get rid of some onchange / read / write code.</li>
<li>the module does not allow to set low level attributes such as
database server, etc.</li>
<li>server.env.techname.mixins tech_name field could leverage the new
option for computable / writable fields and get rid of some onchange
/ read / write code.</li>
</ul>
</div>
<div class="section" id="bug-tracker">
@ -542,7 +548,7 @@ for computable / writable fields and get rid of some onchange / read / write cod
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/server-env/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/server-env/issues/new?body=module:%20server_environment%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/server-env/issues/new?body=module:%20server_environment%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
@ -577,7 +583,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-env/tree/16.0/server_environment">OCA/server-env</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-env/tree/17.0/server_environment">OCA/server-env</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>

View File

@ -1,115 +0,0 @@
==================================
Server Environment Data Encryption
==================================
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:8b7167f4311edd86055de2f0601f9348263e6b72366abeb835d57f71491b6e33
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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/16.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-16-0/server-env-16-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=16.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:%2016.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.
This module is part of the `OCA/server-env <https://github.com/OCA/server-env/tree/16.0/server_environment_data_encryption>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@ -1 +0,0 @@
from . import models

View File

@ -1,12 +0,0 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Server Environment Data Encryption",
"version": "16.0.1.0.0",
"development_status": "Alpha",
"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"],
}

View File

@ -1,49 +0,0 @@
# 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 ""

View File

@ -1,53 +0,0 @@
# 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"

View File

@ -1,51 +0,0 @@
# 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"

View File

@ -1,48 +0,0 @@
# 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"
"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
#, 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 ""

View File

@ -1 +0,0 @@
from . import server_env_mixin

View File

@ -1,201 +0,0 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import json
import logging
from lxml import etree
from odoo import _, api, models
from odoo.exceptions import ValidationError
from odoo.tools.config import config
_logger = logging.getLogger(__name__)
class ServerEnvMixin(models.AbstractModel):
_inherit = "server.env.mixin"
def _current_env_encrypted_key_exists(self):
env = self.env["encrypted.data"]._retrieve_env()
key_name = "encryption_key_%s" % env
key_str = config.get(key_name)
key_exists = key_str and True or False
if not key_exists:
logging.warning(
"The minimal configuration is missing. You need at least to add an "
"encryption key for the current environment : %s. While the "
"configuration is missing, the module has no effect",
env,
)
return key_exists
def _compute_server_env_from_default(self, field_name, options):
"""First return database encrypted value then default value"""
# in case of bad configuration (no encryption key for current env) the module
# is useless, we do fallback directly on serven_environement behavior
if not self._current_env_encrypted_key_exists():
return super()._compute_server_env_from_default(field_name, options)
encrypted_data_name = "{},{}".format(self._name, self.id)
env = self.env.context.get("environment", None)
vals = (
self.env["encrypted.data"]
.sudo()
._encrypted_read_json(encrypted_data_name, env=env)
)
if vals.get(field_name):
self[field_name] = vals[field_name]
else:
return super()._compute_server_env_from_default(field_name, options)
def _inverse_server_env(self, field_name):
"""
When this module is installed, we store values into encrypted data
env instead of a default field in database (not env dependent).
"""
# in case of bad configuration (no encryption key for current env) the module
# is useless, we do fallback directly on serven_environement behavior
if not self._current_env_encrypted_key_exists():
return super()._inverse_server_env(field_name)
is_editable_field = self._server_env_is_editable_fieldname(field_name)
encrypted_data_obj = self.env["encrypted.data"].sudo()
env = self.env.context.get("environment", None)
for record in self:
if record[is_editable_field]:
encrypted_data_name = "{},{}".format(record._name, record.id)
values = encrypted_data_obj._encrypted_read_json(
encrypted_data_name, env=env
)
new_val = {field_name: record[field_name]}
values.update(new_val)
encrypted_data_obj._encrypted_store_json(
encrypted_data_name, values, env=env
)
def action_change_env_data_encrypted_fields(self):
action_id = self.env.context.get("params", {}).get("action")
if not action_id:
# We don't know which action we are using... take default one
action = self.get_formview_action()
else:
action = (
self.env["ir.actions.act_window"].browse(action_id).sudo().read()[0]
)
action["view_mode"] = "form"
action["res_id"] = self.id
views_form = []
for view_id, view_type in action.get("views", []):
if view_type == "form":
views_form.append((view_id, view_type))
action["views"] = views_form
return action
def _get_extra_environment_info_div(self, current_env, extra_envs):
# if the module configuration is missing (no current env encryption key)
# display a warning instead as the module has no effect.
if not self._current_env_encrypted_key_exists():
button_div = "<div>"
warning_string = _(
"The encryption key for current environement is not defined"
)
elem = etree.fromstring(
"""
<div class="d-flex justify-content-between">
<div class="alert lead {} text-center d-inline">
<strong>{}</strong>
</div>
</div>
""".format(
"alert-danger", warning_string
)
)
return elem
# TODO we could use a qweb template here
button_div = "<div>"
button_string = _("Define values for ")
for environment in extra_envs:
button = """
<button name="action_change_env_data_encrypted_fields"
type="object" string="{}{}"
class="btn btn-lg btn-primary ml-2"
context="{}"/>
""".format(
button_string, environment, {"environment": environment}
)
button_div += "{}".format(button)
button_div += "</div>"
alert_string = _("Modify values for {} environment").format(current_env)
alert_type = (
current_env == config.get("running_env") and "alert-info" or "alert-warning"
)
elem = etree.fromstring(
"""
<div class="d-flex justify-content-between">
<div class="alert lead {} text-center d-inline">
<strong>{}</strong>
</div>
{}
</div>
""".format(
alert_type, alert_string, button_div
)
)
return elem
def _set_readonly_form_view(self, doc):
for field in doc.iter("field"):
env_fields = self._server_env_fields.keys()
field_name = field.get("name")
if field_name in env_fields:
continue
field.set("readonly", "1")
field.set("modifiers", json.dumps({"readonly": True}))
def _update_form_view_from_env(self, arch, view_type):
if view_type != "form":
return arch
current_env = self.env.context.get("environment") or config.get("running_env")
# Important to keep this list sorted. It makes sure the button to
# switch environment will always be in the same order. (more user
# friendly) and the test would fail without it as the order could
# change randomly and the view would then also change randomly
other_environments = sorted(
[
key[15:]
for key, val in config.options.items()
if key.startswith("encryption_key_") and val and key[15:] != current_env
]
)
if not current_env:
raise ValidationError(
_(
"you need to define the running_env entry in your odoo "
"configuration file"
)
)
node = arch.xpath("//sheet")
if node:
node = node[0]
elem = self._get_extra_environment_info_div(current_env, other_environments)
node.insert(0, elem)
if current_env != config.get("running_env"):
self._set_readonly_form_view(arch)
else:
_logger.error("Missing sheet for form view on object {}".format(self._name))
return arch
@api.model
def _get_view(self, view_id=None, view_type="form", **options):
arch, view = super()._get_view(view_id=view_id, view_type=view_type, **options)
arch = self._update_form_view_from_env(arch, view_type)
return arch, view
def _get_view_cache_key(self, view_id=None, view_type="form", **options):
res = super()._get_view_cache_key(
view_id=view_id, view_type=view_type, **options
)
res += (self.env.context.get("environment", False),)
return res

View File

@ -1,23 +0,0 @@
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

View File

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

View File

@ -1,6 +0,0 @@
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.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

View File

@ -1,461 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>Server Environment Data Encryption</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
border: 0 }
table.borderless td, table.borderless th {
/* Override padding for "table.docutils td" with "! important".
The right padding separates the table cells. */
padding: 0 0.5em 0 0 ! important }
.first {
/* Override more specific margin styles with "! important". */
margin-top: 0 ! important }
.last, .with-subtitle {
margin-bottom: 0 ! important }
.hidden {
display: none }
.subscript {
vertical-align: sub;
font-size: smaller }
.superscript {
vertical-align: super;
font-size: smaller }
a.toc-backref {
text-decoration: none ;
color: black }
blockquote.epigraph {
margin: 2em 5em ; }
dl.docutils dd {
margin-bottom: 0.5em }
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
overflow: hidden;
}
/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
font-weight: bold }
*/
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
color: red ;
font-weight: bold ;
font-family: sans-serif }
/* Uncomment (and remove this text!) to get reduced vertical space in
compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
margin-bottom: 0.5em }
div.compound .compound-last, div.compound .compound-middle {
margin-top: 0.5em }
*/
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em ;
margin-right: 2em }
div.footer, div.header {
clear: both;
font-size: smaller }
div.line-block {
display: block ;
margin-top: 1em ;
margin-bottom: 1em }
div.line-block div.line-block {
margin-top: 0 ;
margin-bottom: 0 ;
margin-left: 1.5em }
div.sidebar {
margin: 0 0 0.5em 1em ;
border: medium outset ;
padding: 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
margin-top: 0.4em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr.docutils {
width: 75% }
img.align-left, .figure.align-left, object.align-left, table.align-left {
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right, object.align-right, table.align-right {
clear: right ;
float: right ;
margin-left: 1em }
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
table.align-center {
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left }
.align-center {
clear: both ;
text-align: center }
.align-right {
text-align: right }
/* reset inner alignment in figures */
div.align-right {
text-align: inherit }
/* div.align-center * { */
/* text-align: left } */
.align-top {
vertical-align: top }
.align-middle {
vertical-align: middle }
.align-bottom {
vertical-align: bottom }
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font: inherit }
pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.pre {
white-space: pre }
span.problematic {
color: red }
span.section-subtitle {
/* font-size relative to parent (h1..h6 element) */
font-size: 80% }
table.citation {
border-left: solid 1px gray;
margin-left: 1px }
table.docinfo {
margin: 2em 4em }
table.docutils {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.footnote {
border-left: solid 1px black;
margin-left: 1px }
table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
table.docutils th.field-name, table.docinfo th.docinfo-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap ;
padding-left: 0 }
/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
border: 0px;
border-top: 2px solid;
border-bottom: 2px solid;
border-collapse: collapse;
}
table.docutils.booktabs * {
border: 0px;
}
table.docutils.booktabs th {
border-bottom: thin solid;
text-align: left;
}
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% }
ul.auto-toc {
list-style-type: none }
</style>
</head>
<body>
<div class="document" id="server-environment-data-encryption">
<h1 class="title">Server Environment Data Encryption</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:8b7167f4311edd86055de2f0601f9348263e6b72366abeb835d57f71491b6e33
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Alpha" src="https://img.shields.io/badge/maturity-Alpha-red.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/server-env/tree/16.0/server_environment_data_encryption"><img alt="OCA/server-env" src="https://img.shields.io/badge/github-OCA%2Fserver--env-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/server-env-16-0/server-env-16-0-server_environment_data_encryption"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/server-env&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>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.</p>
<div class="admonition important">
<p class="first admonition-title">Important</p>
<p class="last">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.
<a class="reference external" href="https://odoo-community.org/page/development-status">More details on development status</a></p>
</div>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#configuration" id="toc-entry-1">Configuration</a></li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-2">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-3">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-4">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-5">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-6">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="configuration">
<h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
<p>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.</p>
<p>Example :
Development environment</p>
<pre class="literal-block">
[options]
running_env=dev
encryption_key_dev=XXX
</pre>
<p>Pre-production environment</p>
<pre class="literal-block">
[options]
running_env=preprod
encryption_key_preprod=YYY
</pre>
<p>Production environment</p>
<pre class="literal-block">
[options]
running_env=prod
encryption_key_dev=XXX
encryption_key_preprod=YYY
encryption_key_prod=ZZZ
</pre>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/server-env/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/server-env/issues/new?body=module:%20server_environment_data_encryption%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#toc-entry-3">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
<ul class="simple">
<li>Akretion</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<ul class="simple">
<li>Florian da Costa &lt;<a class="reference external" href="mailto:florian.dacosta&#64;akretion.com">florian.dacosta&#64;akretion.com</a>&gt;</li>
<li>Sébastien Beau &lt;<a class="reference external" href="mailto:sebastien.beau&#64;akretion.com">sebastien.beau&#64;akretion.com</a>&gt;</li>
<li>Benoît Guillot &lt;<a class="reference external" href="mailto:benoit.guillot&#64;akretion.com">benoit.guillot&#64;akretion.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-env/tree/16.0/server_environment_data_encryption">OCA/server-env</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
</div>
</body>
</html>

View File

@ -1 +0,0 @@
from . import test_server_environment_data_encrypt

View File

@ -1,22 +0,0 @@
<form string="Test">
<header>
<button
string="Reset Confirmation"
type="object"
name="set_draft"
states="done"
/>
</header>
<sheet>
<group col="4">
<field name="test" modifiers="{&quot;required&quot;: true}" />
<field
name="test2"
attrs="{'readonly': [('type_env_is_editable', '=', False)]}"
on_change="1"
modifiers="{&quot;readonly&quot;: [[&quot;type_env_is_editable&quot;, &quot;=&quot;, false]]}"
/>
<field name="date" modifiers="{&quot;readonly&quot;: true}" />
</group>
</sheet>
</form>

View File

@ -1,43 +0,0 @@
<form string="Test">
<header>
<button
string="Reset Confirmation"
type="object"
name="set_draft"
states="done"
/>
</header>
<sheet>
<div class="d-flex justify-content-between">
<div class="alert lead alert-info text-center d-inline">
<strong>Modify values for test environment</strong>
</div>
<div>
<button
name="action_change_env_data_encrypted_fields"
type="object"
string="Define values for preprod"
class="btn btn-lg btn-primary ml-2"
context="{'environment': 'preprod'}"
/>
<button
name="action_change_env_data_encrypted_fields"
type="object"
string="Define values for prod"
class="btn btn-lg btn-primary ml-2"
context="{'environment': 'prod'}"
/>
</div>
</div><group col="4">
<field name="test" modifiers="{&quot;required&quot;: true}" />
<field
name="test2"
attrs="{'readonly': [('type_env_is_editable', '=', False)]}"
on_change="1"
modifiers="{&quot;readonly&quot;: [[&quot;type_env_is_editable&quot;, &quot;=&quot;, false]]}"
/>
<field name="date" modifiers="{&quot;readonly&quot;: true}" />
</group>
</sheet>
</form>

View File

@ -1,44 +0,0 @@
<form string="Test">
<header>
<button
string="Reset Confirmation"
type="object"
name="set_draft"
states="done"
/>
</header>
<sheet>
<div class="d-flex justify-content-between">
<div class="alert lead alert-warning text-center d-inline">
<strong>Modify values for prod environment</strong>
</div>
<div>
<button
name="action_change_env_data_encrypted_fields"
type="object"
string="Define values for preprod"
class="btn btn-lg btn-primary ml-2"
context="{'environment': 'preprod'}"
/>
<button
name="action_change_env_data_encrypted_fields"
type="object"
string="Define values for test"
class="btn btn-lg btn-primary ml-2"
context="{'environment': 'test'}"
/>
</div>
</div><group col="4">
<field name="test" modifiers="{&quot;readonly&quot;: true}" readonly="1" />
<field
name="test2"
attrs="{'readonly': [('type_env_is_editable', '=', False)]}"
on_change="1"
modifiers="{&quot;readonly&quot;: true}"
readonly="1"
/>
<field name="date" modifiers="{&quot;readonly&quot;: true}" readonly="1" />
</group>
</sheet>
</form>

View File

@ -1,47 +0,0 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from pathlib import Path
from lxml import etree
from odoo.addons.data_encryption.tests.common import CommonDataEncrypted
class TestServerEnvDataEncrypted(CommonDataEncrypted):
def test_dynamic_view_current_env(self):
self.maxDiff = None
self.set_new_key_env("prod")
self.set_new_key_env("preprod")
mixin_obj = self.env["server.env.mixin"]
base_path = Path(__file__).parent / "fixtures" / "base.xml"
xml_str = base_path.read_text()
xml = etree.XML(xml_str)
res_xml = mixin_obj._update_form_view_from_env(xml, "form")
expected_xml_path = Path(__file__).parent / "fixtures" / "res1.xml"
expected_xml = expected_xml_path.read_text()
# convert both to xml with parser removing space then convert to string to
# compare
parser = etree.XMLParser(remove_blank_text=True)
res_xml_str = etree.tostring(etree.XML(etree.tostring(res_xml), parser=parser))
expected_xml_str = etree.tostring(etree.XML(expected_xml, parser=parser))
self.assertEqual(res_xml_str, expected_xml_str)
def test_dynamic_view_other_env(self):
self.maxDiff = None
self.set_new_key_env("prod")
self.set_new_key_env("preprod")
mixin_obj = self.env["server.env.mixin"]
base_path = Path(__file__).parent / "fixtures" / "base.xml"
xml_str = base_path.read_text()
xml = etree.XML(xml_str)
res_xml = mixin_obj.with_context(environment="prod")._update_form_view_from_env(
xml, "form"
)
expected_xml_path = Path(__file__).parent / "fixtures" / "res2.xml"
expected_xml = expected_xml_path.read_text()
# convert both to xml with parser removing space then convert to string to
# compare
parser = etree.XMLParser(remove_blank_text=True)
res_xml_str = etree.tostring(etree.XML(etree.tostring(res_xml), parser=parser))
expected_xml_str = etree.tostring(etree.XML(expected_xml, parser=parser))
self.assertEqual(res_xml_str, expected_xml_str)

View File

@ -1,120 +0,0 @@
======================================
Server Environment Ir Config Parameter
======================================
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:29c97aeb304203d7c075a8ff1295720253ea06b1f8d4fc57ef0fa71b45f3a38b
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |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/16.0/server_environment_ir_config_parameter
: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-16-0/server-env-16-0-server_environment_ir_config_parameter
: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=16.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
Override System Parameters from server environment file.
**Table of contents**
.. contents::
:local:
Configuration
=============
To configure this module, you need to add a section ``[ir.config_parameter]`` to
you server_environment_files configurations, where the keys are the same
as would normally be set in the Systems Parameter Odoo menu.
When first using a value, the system will read it from the configuration file
and override any value that would be present in the database, so the configuration
file has precedence.
When creating or modifying values that are in the configuration file, the
module replace changes, enforcing the configuration value.
For example you can use this module in combination with web_environment_ribbon:
.. code::
[ir.config_parameter]
ribbon.name=DEV
Usage
=====
Before using this module, you must be familiar with the
server_environment module.
Known issues / Roadmap
======================
When the user modifies System Parameters that are defined in the config
file, the changes are ignored. It would be nice to display which system
parameters come from the config file and possibly make their key and value
readonly in the user interface.
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_ir_config_parameter%0Aversion:%2016.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
~~~~~~~
* ACSONE SA/NV
Contributors
~~~~~~~~~~~~
* Stéphane Bidoul <stephane.bidoul@acsone.eu> (https://acsone.eu)
* Thierry Ducrest <thierry.ducrest@camptocamp.com>
* Gilles Meyomesse <gilles.meyomesse@acsone.eu> (https://acsone.eu)
* Sylvain LE GAL (https://www.twitter.com/legalsylvain)
Other credits
~~~~~~~~~~~~~
This module is maintained by:
* Odoo Community Association
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.
This module is part of the `OCA/server-env <https://github.com/OCA/server-env/tree/16.0/server_environment_ir_config_parameter>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@ -1 +0,0 @@
from . import models

View File

@ -1,16 +0,0 @@
# Copyright 2016-2018 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Server Environment Ir Config Parameter",
"summary": """
Override System Parameters from server environment file""",
"version": "16.0.1.1.0",
"license": "AGPL-3",
"author": "ACSONE SA/NV, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/server-env",
"depends": ["server_environment"],
"data": [
"views/view_ir_config_parameter.xml",
],
}

View File

@ -1,46 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * server_environment_ir_config_parameter
#
# Translators:
# Niki Waibel <niki.waibel@gmail.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-22 01:12+0000\n"
"PO-Revision-Date: 2017-06-22 01:12+0000\n"
"Last-Translator: Niki Waibel <niki.waibel@gmail.com>, 2017\n"
"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n"
"Language: de\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_ir_config_parameter
#: model:ir.model.fields,field_description:server_environment_ir_config_parameter.field_ir_config_parameter__is_environment
msgid "Defined by environment"
msgstr ""
#. module: server_environment_ir_config_parameter
#: model:ir.model.fields,help:server_environment_ir_config_parameter.field_ir_config_parameter__is_environment
msgid ""
"If check, the value in the database will be ignored and alternatively, the "
"system will use the key defined in your odoo.cfg environment file."
msgstr ""
#. module: server_environment_ir_config_parameter
#. odoo-python
#: code:addons/server_environment_ir_config_parameter/models/ir_config_parameter.py:0
#, python-format
msgid "Key %s is empty in server_environment_file"
msgstr ""
#. module: server_environment_ir_config_parameter
#: model:ir.model,name:server_environment_ir_config_parameter.model_ir_config_parameter
msgid "System Parameter"
msgstr ""
#~ msgid "ir.config_parameter"
#~ msgstr "ir.config_parameter"

View File

@ -1,49 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * server_environment_ir_config_parameter
#
# Translators:
# Pedro M. Baeza <pedro.baeza@gmail.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-22 01:12+0000\n"
"PO-Revision-Date: 2023-07-25 13:10+0000\n"
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\n"
"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\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_ir_config_parameter
#: model:ir.model.fields,field_description:server_environment_ir_config_parameter.field_ir_config_parameter__is_environment
msgid "Defined by environment"
msgstr "Definido por el entorno"
#. module: server_environment_ir_config_parameter
#: model:ir.model.fields,help:server_environment_ir_config_parameter.field_ir_config_parameter__is_environment
msgid ""
"If check, the value in the database will be ignored and alternatively, the "
"system will use the key defined in your odoo.cfg environment file."
msgstr ""
"Si se marca, el valor en la base de datos será ignorado y alternativamente, "
"el sistema utilizará la clave definida en su archivo de entorno odoo.cfg."
#. module: server_environment_ir_config_parameter
#. odoo-python
#: code:addons/server_environment_ir_config_parameter/models/ir_config_parameter.py:0
#, python-format
msgid "Key %s is empty in server_environment_file"
msgstr "La clave %s está vacía en server_environment_file"
#. module: server_environment_ir_config_parameter
#: model:ir.model,name:server_environment_ir_config_parameter.model_ir_config_parameter
msgid "System Parameter"
msgstr "Parámetros del sistema"
#~ msgid "ir.config_parameter"
#~ msgstr "ir.config_parameter"

View File

@ -1,49 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * server_environment_ir_config_parameter
#
# Translators:
# Paolo Valier <paolo.valier@hotmail.it>, 2018
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-01-06 02:25+0000\n"
"PO-Revision-Date: 2024-01-02 11:39+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\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_ir_config_parameter
#: model:ir.model.fields,field_description:server_environment_ir_config_parameter.field_ir_config_parameter__is_environment
msgid "Defined by environment"
msgstr "Definito dall'ambiente"
#. module: server_environment_ir_config_parameter
#: model:ir.model.fields,help:server_environment_ir_config_parameter.field_ir_config_parameter__is_environment
msgid ""
"If check, the value in the database will be ignored and alternatively, the "
"system will use the key defined in your odoo.cfg environment file."
msgstr ""
"Se selezionata, il valore nel database verrà ignorato e in alternativa il "
"sistema utilizzerà la chiave definita nel file ambiente odoo.cfg."
#. module: server_environment_ir_config_parameter
#. odoo-python
#: code:addons/server_environment_ir_config_parameter/models/ir_config_parameter.py:0
#, python-format
msgid "Key %s is empty in server_environment_file"
msgstr "La chiave %s è vuota in server_environment_file"
#. module: server_environment_ir_config_parameter
#: model:ir.model,name:server_environment_ir_config_parameter.model_ir_config_parameter
msgid "System Parameter"
msgstr "Parametro di sistema"
#~ msgid "ir.config_parameter"
#~ msgstr "ir.config_parameter"

Some files were not shown because too many files have changed in this diff Show More