move some configurations out of the database
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
All the settings will be read only and 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’).
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.
To install this module, you need to provide a companion module called
server_environment_files. You can copy and customize the provided
server_environment_files_sample module for this purpose.
To configure this module, you need to edit the main configuration file
of your instance, and add a directive called
used values are ‘dev’, ‘test’, ‘production’:
You should then 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;
- finally, you can override or extend values in the main configuration file of you instance.
Values associated to keys containing ‘passw’ are only displayed in the ‘dev’ environment.
To use this module, in your code, you can follow this example:
from openerp.addons.server_environment import serv_config for key, value in serv_config.items('external_service.ftp'): print (key, value) serv_config.get('external_service.ftp', 'tls')
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.
- do not add a static directory to this addon nor any OCA/server-tool module that depend on it so its not imported unless installed in a database; doing so would break installations where OCA/server-tools is in the addons-path but not otherwise used, due to the absence of a server_environement_files addon.
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 smashing it by providing a detailed and welcomed feedback.
- Odoo Community Association: Icon.
- Alexandre Fayolle <email@example.com>
- Daniel Reis <firstname.lastname@example.org>
- Florent Xicluna <email@example.com>
- Guewen Baconnier <firstname.lastname@example.org>
- Holger Brunn <email@example.com>
- Joël Grand-Guillaume <firstname.lastname@example.org>
- Nicolas Bessi <email@example.com>
- Yannick Vaucher <firstname.lastname@example.org>
This module is maintained by the OCA.
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.
To contribute to this module, please visit https://odoo-community.org.
Release history Release notifications
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size odoo9_addon_server_environment-126.96.36.199.0-py2-none-any.whl (153.6 kB)||File type Wheel||Python version py2||Upload date||Hashes View hashes|
Hashes for odoo9_addon_server_environment-188.8.131.52.0-py2-none-any.whl