Skip to main content
License: GPL-3

server environment

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.

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’).

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.

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.

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 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.

Usage

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')
Try me on Runbot

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.

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 smashing it by providing a detailed and welcomed feedback.

Credits

Images

  • Odoo Community Association: Icon.

Contributors

Maintainer

Odoo Community Association

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.

Metadata

Release files for odoo10-addon-server-environment 10.0.1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for odoo10-addon-server-environment 10.0.1.3.0
File Interpreter ABI Platform Actions
odoo10_addon_server_environment-10.0.1.3.0-py2-none-any.whl Python 2 none any Details for odoo10_addon_server_environment-10.0.1.3.0-py2-none-any.whl

Release files / odoo10_addon_server_environment-10.0.1.3.0-py2-none-any.whl

Download URL odoo10_addon_server_environment-10.0.1.3.0-py2-none-any.whl
Size 150.9 kB
Tags Python 2
SHA-256 checksum
How to use checksums
5bb0360154536b1935571c41945659a2297cdb85cf5a63bf88e8fe99de1c0b3a
BLAKE2b-256 checksum
How to use checksums
aeb2b89bef2695c2ec6b842ada3b2dfdeab027784930100c00a4b825fd13fdaf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/30.4.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.5.3

Security for odoo10-addon-server-environment 10.0.1.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page