diff --git a/server_environment/README.rst b/server_environment/README.rst index 1a610c21b..5f5a617ba 100644 --- a/server_environment/README.rst +++ b/server_environment/README.rst @@ -1,7 +1,3 @@ -.. image:: https://odoo-community.org/readme-banner-image - :target: https://odoo-community.org/get-involved?utm_source=readme - :alt: Odoo Community Association - ====================================== server configuration environment files ====================================== @@ -17,7 +13,7 @@ server configuration environment files .. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png :target: https://odoo-community.org/page/development-status :alt: Production/Stable -.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png +.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png :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 @@ -100,12 +96,12 @@ 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 -------------------- @@ -181,7 +177,9 @@ Server environment integration ------------------------------ Read the documentation of the class -`models/server_env_mixin.py `__. +`models/server_env_mixin.py `__ and +[models/server_env_tech_name_mixin.py] +(models/server_env_tech_name_mixin.py) Usage ===== @@ -208,20 +206,20 @@ 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"] + _inherit = ["storage.backend", "server.env.techname.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 =========== @@ -244,18 +242,18 @@ Authors Contributors ------------ -- Florent Xicluna (Wingo) -- Nicolas Bessi -- Alexandre Fayolle -- Daniel Reis -- Holger Brunn -- Leonardo Pistone -- Adrien Peiffer -- Thierry Ducrest -- Guewen Baconnier -- Thomas Binfeld -- Stéphane Bidoul -- Simone Orsi +- Florent Xicluna (Wingo) +- Nicolas Bessi +- Alexandre Fayolle +- Daniel Reis +- Holger Brunn +- Leonardo Pistone +- Adrien Peiffer +- Thierry Ducrest +- Guewen Baconnier +- Thomas Binfeld +- Stéphane Bidoul +- Simone Orsi Maintainers ----------- diff --git a/server_environment/models/server_env_tech_name_mixin.py b/server_environment/models/server_env_tech_name_mixin.py index d0b6bbbd9..8a536ce74 100644 --- a/server_environment/models/server_env_tech_name_mixin.py +++ b/server_environment/models/server_env_tech_name_mixin.py @@ -16,17 +16,18 @@ class ServerEnvTechNameMixin(models.AbstractModel): This mixin helps solve the problem by providing a tech name field and a cleanup machinery as well as a unique constrain. - To use this mixin add it to the _inherit attr of your module like: + To use this mixin add it to the _inherit attr of your model like: + (instead of `server.env.mixin`) _inherit = [ "my.model", "server.env.techname.mixin", - "server.env.mixin", ] """ _name = "server.env.techname.mixin" + _inherit = "server.env.mixin" _description = "Server environment technical name" _sql_constraints = [ ( diff --git a/server_environment/readme/CONFIGURE.md b/server_environment/readme/CONFIGURE.md index 225be2d0b..76260f2b5 100644 --- a/server_environment/readme/CONFIGURE.md +++ b/server_environment/readme/CONFIGURE.md @@ -97,4 +97,5 @@ 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). +[models/server_env_mixin.py](models/server_env_mixin.py) and [models/server_env_tech_name_mixin.py] +(models/server_env_tech_name_mixin.py) diff --git a/server_environment/readme/USAGE.md b/server_environment/readme/USAGE.md index e85984943..ed811ae09 100644 --- a/server_environment/readme/USAGE.md +++ b/server_environment/readme/USAGE.md @@ -16,6 +16,6 @@ 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"] + _inherit = ["storage.backend", "server.env.techname.mixin"] [...] diff --git a/server_environment/static/description/index.html b/server_environment/static/description/index.html index 23174d901..2942bec5a 100644 --- a/server_environment/static/description/index.html +++ b/server_environment/static/description/index.html @@ -3,7 +3,7 @@ -README.rst +server configuration environment files -
+
+

server configuration environment files

- - -Odoo Community Association - -
-

server configuration environment files

-

Production/Stable License: LGPL-3 OCA/server-env Translate me on Weblate Try me on Runboat

+

Production/Stable License: LGPL-3 OCA/server-env Translate me on Weblate Try me on Runboat

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 @@ -410,7 +405,7 @@

server configuration environment files

-

Installation

+

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 @@ -422,7 +417,7 @@

Installation

SERVER_ENV_CONFIG and SERVER_ENV_CONFIG_SECRET.

-

Configuration

+

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’:

@@ -441,21 +436,21 @@

Configuration

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

+

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;
  • +
  • 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

+

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 @@ -505,7 +500,7 @@

Environment variable

reference records. See “USAGE”.
-

Default values

+

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 @@ -514,13 +509,15 @@

Default values

Note: empty environment keys always take precedence over default fields

-

Server environment integration

+

Server environment integration

Read the documentation of the class -models/server_env_mixin.py.

+models/server_env_mixin.py and +[models/server_env_tech_name_mixin.py] +(models/server_env_tech_name_mixin.py)

-

Usage

+

Usage

You can include a mixin in your model and configure the env-computed fields by an override of _server_env_fields.

@@ -538,25 +535,25 @@ 

Usage

 class StorageBackend(models.Model):
     _name = "storage.backend"
-    _inherit = ["storage.backend", "server.env.techname.mixin", "server.env.mixin"]
+    _inherit = ["storage.backend", "server.env.techname.mixin"]
 
     [...]
 
-

Known issues / Roadmap

+

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.
  • +
  • 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.
  • +option for computable / writable fields and get rid of some onchange +/ read / write code.
-

Bug Tracker

+

Bug Tracker

Bugs are tracked on GitHub 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 @@ -564,15 +561,15 @@

Bug Tracker

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

-

Credits

+

Credits

-

Authors

+

Authors

  • Camptocamp
-

Contributors

+

Contributors

-

Maintainers

+

Maintainers

This module is maintained by the OCA.

Odoo Community Association @@ -602,6 +599,5 @@

Maintainers

-