Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ Available addons
addon | version | maintainers | summary
--- | --- | --- | ---
[data_encryption](data_encryption/) | 17.0.1.0.0 | | Store accounts and credentials encrypted by environment
[mail_environment](mail_environment/) | 17.0.1.0.1 | | Configure mail servers with server_environment_files
[mail_environment](mail_environment/) | 17.0.1.0.2 | | Configure mail servers with server_environment_files
[mail_environment_office365](mail_environment_office365/) | 17.0.1.0.0 | | Configure Office365 parameters with environment variables via server_environment
[server_environment](server_environment/) | 17.0.1.2.2 | | move some configurations out of the database
[server_environment](server_environment/) | 17.0.1.2.3 | | move some configurations out of the database
[server_environment_autocreate](server_environment_autocreate/) | 17.0.1.0.0 | | Add ability to auto create records
[server_environment_data_encryption](server_environment_data_encryption/) | 17.0.1.0.0 | <a href='https://github.com/florian-dacosta'><img src='https://github.com/florian-dacosta.png' width='32' height='32' style='border-radius:50%;' alt='florian-dacosta'/></a> | Server Environment Data Encryption
[server_environment_ir_config_parameter](server_environment_ir_config_parameter/) | 17.0.1.0.0 | | Override System Parameters from server environment file
Expand Down
2 changes: 1 addition & 1 deletion mail_environment/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Mail configuration with server_environment
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:0a35903a063255046023b3bb954ab183618c0e93896496338fe86c7f24dbbb26
!! source digest: sha256:b60ef476e58ccd2c00acd9a4844aa0155f3f593ddcbd3775e5cc12a362ec0340
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down
2 changes: 1 addition & 1 deletion mail_environment/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{
"name": "Mail configuration with server_environment",
"version": "17.0.1.0.1",
"version": "17.0.1.0.2",
"category": "Tools",
"summary": "Configure mail servers with server_environment_files",
"author": "Camptocamp, Odoo Community Association (OCA)",
Expand Down
9 changes: 9 additions & 0 deletions mail_environment/migrations/17.0.1.0.2/post-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright 2026 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from openupgradelib import openupgrade


@openupgrade.migrate()
def migrate(env, version):
env["ir.mail_server"]._preserve_not_env_managed_data(["smtp_authentication"])
2 changes: 1 addition & 1 deletion mail_environment/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ <h1>Mail configuration with server_environment</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:0a35903a063255046023b3bb954ab183618c0e93896496338fe86c7f24dbbb26
!! source digest: sha256:b60ef476e58ccd2c00acd9a4844aa0155f3f593ddcbd3775e5cc12a362ec0340
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/server-env/tree/17.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-17-0/server-env-17-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=17.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
Expand Down
2 changes: 1 addition & 1 deletion server_environment/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ server configuration environment files
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:bfb242c8cf384684a1067a797167c4d3dccf13cd9fc63a8520ad88d08861aece
!! source digest: sha256:8299be39e05bf3977f1c2fcb06c4577899dcfcbc4b1e8d07f612a7fd568c9a70
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
Expand Down
2 changes: 1 addition & 1 deletion server_environment/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{
"name": "server configuration environment files",
"version": "17.0.1.2.2",
"version": "17.0.1.2.3",
"depends": ["base", "base_sparse_field"],
"author": "Camptocamp,Odoo Community Association (OCA)",
"summary": "move some configurations out of the database",
Expand Down
28 changes: 28 additions & 0 deletions server_environment/models/server_env_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,3 +425,31 @@ def _setup_base(self):
self._server_env_transform_field_to_read_from_env(field)
self._server_env_add_is_editable_field(field)
return

@api.model
def _preserve_not_env_managed_data(self, field_name_list):
"""
Helper function typically used for hooks and migration scripts.
Restores database values for fields transitioning to 'server env managed'.

When a field is defined as managed by the server environment, Odoo
ignores the value stored in the database, prioritizing the environment
configuration instead. If no environment configuration exists, the field
may effectively lose its previous value.

This method forces to 'persist' these values if they are not
explicitly overridden by the current environment configuration.
"""
self.env.cr.execute(f"SELECT * FROM {self._table}")
for row in self.env.cr.dictfetchall():
record = (
self.env[self._name]
.with_context(active_test=False)
.search([("id", "=", row["id"])])
)
if record:
record_values = {}
for field_name in field_name_list:
if field_name in row:
record_values[field_name] = row[field_name]
record.update(record_values)
2 changes: 1 addition & 1 deletion server_environment/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ <h1>server configuration environment files</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:bfb242c8cf384684a1067a797167c4d3dccf13cd9fc63a8520ad88d08861aece
!! source digest: sha256:8299be39e05bf3977f1c2fcb06c4577899dcfcbc4b1e8d07f612a7fd568c9a70
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/license-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
Expand Down