Commit Graph

75 Commits

Author SHA1 Message Date
OCA-git-bot b37b684d6c [BOT] post-merge updates 2024-01-08 08:39:21 +00:00
oca-ci 753baf3b26 [UPD] Update server_environment.pot 2024-01-08 08:37:35 +00:00
OCA-git-bot 9c834bf7a2 Merge PR #168 into 17.0
Signed-off-by gurneyalex
2024-01-08 08:36:00 +00:00
Marcos Oitaben 35e6ef913a [17.0][FIX]server_environment: custom fields must start with x_ 2023-11-15 14:43:38 +01:00
Marcos Oitaben 344d6a7582 [MIG] server_environment: Migration to 17.0 2023-11-14 14:13:43 +01:00
Marcos Oitaben 1748ef0a01 [IMP] server_environment: pre-commit stuff 2023-11-13 08:34:15 +01:00
Ivorra78 3bdf064def Translated using Weblate (Spanish)
Currently translated at 100.0% (107 of 107 strings)

Translation: server-env-16.0/server-env-16.0-server_environment
Translate-URL: https://translation.odoo-community.org/projects/server-env-16-0/server-env-16-0-server_environment/es/
2023-11-13 08:34:15 +01:00
Stéphane Bidoul 399d7aef0c Cache get_serverenvironment() 2023-11-13 08:34:15 +01:00
Stéphane Bidoul 9d7e6fe8b9 [FIX] don't use deprecated get_default_locale 2023-11-13 08:34:15 +01:00
Ivorra78 22425ec8ff Translated using Weblate (Spanish)
Currently translated at 65.4% (70 of 107 strings)

Translation: server-env-16.0/server-env-16.0-server_environment
Translate-URL: https://translation.odoo-community.org/projects/server-env-16-0/server-env-16-0-server_environment/es/
2023-11-13 08:34:15 +01:00
Francesco Foresti b2f9c69a65 Translated using Weblate (Italian)
Currently translated at 6.5% (7 of 107 strings)

Translation: server-env-16.0/server-env-16.0-server_environment
Translate-URL: https://translation.odoo-community.org/projects/server-env-16-0/server-env-16-0-server_environment/it/
2023-11-13 08:34:15 +01:00
Quentin Groulard e90a7555fb [IMP] Server env default fields string
Not all fields have their string in the args, but '.string' returns the computed (based on field name) string if not set in the args.
2023-11-13 08:34:15 +01:00
Simone Orsi 8df08c4ecc server_env: fix inverse method (closes #151)
``odoo.fields.determine`` requires inverse methods to have ``__name__`` attribute.
Unfortunately with ``partialmethod`` this attribute is not propagated
even by using ``functools.update_wrapper``.
In any case, `update_wrapper` would propagate the wrapped func name
which is not the same here.

Introduced by 36544651f2
2023-11-13 08:34:15 +01:00
Ivàn Todorovich d847929adb [IMP] server_environment: don't print stack trace when the field can't be read 2023-11-13 08:34:15 +01:00
Simone Orsi 5900959de7 server_environment: do not copy tech_name 2023-11-13 08:34:15 +01:00
Guewen Baconnier 82237b9503 Remove required from tech_name mixin
In some cases, we want to use a tech_name, but we do not use server
environment on all the records, so tech_name should not be required.
2023-11-13 08:34:15 +01:00
Maxime Franco f9f1cdc5dd [MIG] server_environment: Migration to 16.0 2023-11-13 08:34:15 +01:00
Maxime Franco 9d1453d5e6 [IMP] server_environment: black, isort, prettier 2023-11-13 08:34:15 +01:00
Adrien Peiffer ef20d82588 server_environment: Update default fields label
this to avoid Odoo warning messages on labels check
2023-11-13 08:34:15 +01:00
Alexandre Fayolle 97c4c5b829 15.0 server_environment is Production/Stable
server_environment is a dependency of other modules which are in this status
and now that we are checking this, we need to declare the maturity
explicitly
2023-11-13 08:34:15 +01:00
jsanchez cae9e7df22 [FIX] Update server_env_mixin.py to avoid NoneType error 2023-11-13 08:34:15 +01:00
jsanchez 73b77ae3f7 [MIG] server_environment: migration to 15.0 2023-11-13 08:34:15 +01:00
Ivàn Todorovich 742b1f09d3 [UPD] Change LICENSE to LGPL 2023-11-13 08:34:15 +01:00
Mat-moran e2238bc08c Translated using Weblate (Spanish)
Currently translated at 9.1% (9 of 98 strings)

Translation: server-env-14.0/server-env-14.0-server_environment
Translate-URL: https://translation.odoo-community.org/projects/server-env-14-0/server-env-14-0-server_environment/es/
2023-11-13 08:34:15 +01:00
Stéphane Bidoul (ACSONE) 0cd268be3f Translated using Weblate (French)
Currently translated at 8.1% (8 of 98 strings)

Translation: server-env-14.0/server-env-14.0-server_environment
Translate-URL: https://translation.odoo-community.org/projects/server-env-14-0/server-env-14-0-server_environment/fr/
2023-11-13 08:34:15 +01:00
Mourad 20cc6000eb [MIG] server_environment: Migration to 14.0 2023-11-13 08:34:15 +01:00
Mourad 70ac80ea94 [IMP] : black, isort, prettier 2023-11-13 08:34:15 +01:00
Olar Alca [Vauxoo] 4757188522 Update server_environment/serv_config.py
Co-authored-by: Moises Lopez - https://www.vauxoo.com/ <moylop260@vauxoo.com>
2023-11-13 08:34:15 +01:00
Simone Orsi 091852e742 Add mixin for tech name 2023-11-13 08:34:15 +01:00
Simone Orsi f4b9cee411 Fix server_environment version
The PR https://github.com/OCA/server-env/pull/45 has been merged manually and a new version was not bumped.
2023-11-13 08:34:15 +01:00
Simone Orsi 569b00c542 server_environment: running_env default to `test` (fix #44) 2023-11-13 08:34:15 +01:00
Akim Juillerat e3c1da6062 server_environment: Improve tests.common to allow redefinition of serv_config application 2023-11-13 08:34:15 +01:00
Guewen Baconnier 85ee7ca053 Store the 'server.config' fields in sparse fields
This model is used only to display the configuration to authorized
users. It's a TransientModel that dynamically creates the fields for
every odoo configuration parameter, environment variables and some
system ones. Before this change, each new parameter/variable will
create a field in database, which can lead to many issues (lot of
fields, field name too long). Storing the fields in a single JSON
field resolves these issues and is much cleaner anyway.
2023-11-13 08:34:15 +01:00
Denis Roussel b2945fa70b [13.0][FIX] server_environment: Change import for Serialized field 2023-11-13 08:34:15 +01:00
Stéphane Bidoul (ACSONE) 13213d6de5 pre-commit, black, isort 2023-11-13 08:34:15 +01:00
Akim Juillerat 65ba74b1e9 server-environment: Run pre-commit 2023-11-13 08:34:15 +01:00
Akim Juillerat e9d8dccc2d server_environment: lint fixes after migration 2023-11-13 08:34:15 +01:00
Stéphane Bidoul (ACSONE) 7f4a81ac1c pre-commit, black, isort 2023-11-13 08:34:15 +01:00
Akim Juillerat 00ab78db4b [MIG] server_environment: Migration to 13.0 2023-11-13 08:34:15 +01:00
Stéphane Bidoul (ACSONE) b8496b76f2 [MIG] server_environment from 11 to 12 2023-11-13 08:34:15 +01:00
Thomas Binsfeld abd6b5ae84 [REF] Server Environment: restrict access to server config to allowed users
New security group restricting access to server config
Admin is part of the group by default
2023-11-13 08:34:15 +01:00
Guewen Baconnier afb1e2de80 Add SERVER_ENV_CONFIG to configure vars from env. variable
Add SERVER_ENV_CONFIG_SECRET alongside SERVER_ENV_CONFIG

Allows to isolate the secrets in your deployment

Improve documentation regarding variables

Add a server environment mixin

To automatically convert fields into fields reading values from the
environment. Until now, every module reimplements the same computed
field.

Read default values from database when no config is provided

Automatically add <field_name>_env_default for every field transformed
to a "computed from env" field, so a default value can be set. It will
be used when the configuration is not set in a configuration file
(when the key is absent, not empty).

Allow to edit default values for env-computed fields

When they don't have any key in the environment configuration files.
In the UI, when a field is set in a configuration file, the field is
readonly, if not the field is editable. Which means you can selectively
choose which fields depend on the environment and which can use a
"default" value stored in database.

Fix a few small issues in mixin

Use a dictionary to configure the fields

Add global section

Disable prefetch on env-computed fields

As in the inverse field that write the value into the <field>_env_default
we have to browse the record, the prefetch has the effect of calling
compute on the env-computed field which resets the value to it's
previous state before we have the occasion to store it.

Use global section name as first part of the section

Allow to edit all fields on creation

Make server_environment_files optional

Allow integration with keychain

By adding options to change the compute and inverse methods for default
fields

Update documentation of server_environment, bump

Add SERVER_ENV_CONFIG_SECRET alongside SERVER_ENV_CONFIG

Allows to isolate the secrets in your deployment

Reinforce server_environment base tests

Add tests for the server env mixin

Infer configparser getter from field type

Fixes for review feedbacks

Add tests and support of _inherits

Use SavepointCase instead of TransactionCase

It means less records to create for each test

Fix iteration on records
2023-11-13 08:34:15 +01:00
Stéphane Bidoul (ACSONE) 853bcb3e04 remove obsolete .pot files [ci skip] 2023-11-13 08:34:15 +01:00
Thomas Binsfeld b1c39431e2 [REF] Server Environment: remove dependency on server_environement_files
From https://github.com/OCA/server-env/issues/10
2023-11-13 08:34:15 +01:00
Stéphane Bidoul (ACSONE) 13ddf3d7e8 server_environment: bump version
To trigger rebuild following change in setup.py
2023-11-13 08:34:15 +01:00
Thierry Ducrest bd35a03508 [MIG] server_environment: Migration to 11.0 2023-11-13 08:34:14 +01:00
Adrien Peiffer (ACSONE) 9b58d8c18d Migration of server_environment to 10.0 2023-11-13 08:27:16 +01:00
Pedro M. Baeza 81b343ea24 [MIG] Rename manifest files 2023-11-13 08:27:16 +01:00
Pedro M. Baeza 0bd957a1e9 [MIG] Make modules uninstallable 2023-11-13 08:27:16 +01:00
Stéphane Bidoul (ACSONE) 626fdc94da [IMP] load server environment options from odoo rcfile too (#556)
* [IMP] load server environment options from odoo rcfile

This allows delivering the code with default configuration options for
all environments in the server_environment_file module, but letting
the administrator override some configuration entries in the regular
odoo configuration file.

* server_environment_file: update README
2023-11-13 08:27:16 +01:00