server_environment
This module provides a way to define environment-specific configurations for Odoo instances, allowing different settings for development, testing, and production environments stored in files or environment variables.
Key Features
- configuration: Allows setting the running environment in the main Odoo configuration file or via RUNNING_ENV/ODOO_STAGE environment variables.
- server.config: Provides a transient model to display server configurations in the UI, organized into sections for Odoo config, environment-based configs, and system information.
- server.env.mixin: Abstract mixin that transforms model fields into computed fields reading from configuration files, with fallback to default values stored in the database.
- server.env.techname.mixin: Extends the mixin with a tech_name field for unique referencing in configurations, including normalization and uniqueness constraints.
- security: Defines access groups for viewing server configurations, restricting access to authorized users.
- environment variables: Supports SERVER_ENV_CONFIG and SERVER_ENV_CONFIG_SECRET environment variables for setting configurations directly.
- file-based config: Reads configurations from the optional server_environment_files module, supporting default and environment-specific directories.
- secret handling: Automatically hides sensitive values containing keywords like 'passw', 'key', 'secret', or 'token' in non-development environments.
- view modifications: Dynamically sets env-computed fields to readonly when their values are configured in files, preventing direct editing.