33< head >
44< meta http-equiv ="Content-Type " content ="text/html; charset=utf-8 " />
55< meta name ="generator " content ="Docutils: https://docutils.sourceforge.io/ " />
6- < title > README.rst </ title >
6+ < title > server configuration environment files </ title >
77< style type ="text/css ">
88
99/*
360360</ style >
361361</ head >
362362< body >
363- < div class ="document ">
363+ < div class ="document " id ="server-configuration-environment-files ">
364+ < h1 class ="title "> server configuration environment files</ h1 >
364365
365-
366- < a class ="reference external image-reference " href ="https://odoo-community.org/get-involved?utm_source=readme ">
367- < img alt ="Odoo Community Association " src ="https://odoo-community.org/readme-banner-image " />
368- </ a >
369- < div class ="section " id ="server-configuration-environment-files ">
370- < h1 > server configuration environment files</ h1 >
371366<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
372367!! This file is generated by oca-gen-addon-readme !!
373368!! changes will be overwritten. !!
374369!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
375- !! source digest: sha256:39cd61c3a9621d0b7ee7a346adf45f4a2c90e80e6a61e18f182386c6fc90fd19
370+ !! source digest: sha256:dcc784d558683190d604281faea315ff44a3c8ffe998f31f749b06e4def888e1
376371!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
377- < 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/18.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-18-0/server-env-18-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&target_branch=18.0 "> < img alt ="Try me on Runboat " src ="https://img.shields.io/badge/runboat-Try%20me-875A7B.png " /> </ a > </ p >
372+ < 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/licence-LGPL--3-blue.png " /> </ a > < a class ="reference external image-reference " href ="https://github.com/OCA/server-env/tree/18.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-18-0/server-env-18-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&target_branch=18.0 "> < img alt ="Try me on Runboat " src ="https://img.shields.io/badge/runboat-Try%20me-875A7B.png " /> </ a > </ p >
378373< p > This module provides a way to define an environment in the main Odoo
379374configuration file and to read some configurations from files depending
380375on the configured environment: you define the environment in the main
381376configuration file, and the values for the various possible environments
382377are stored in the < tt class ="docutils literal "> server_environment_files</ tt > companion module.</ p >
383378< p > The < tt class ="docutils literal "> server_environment_files</ tt > module is optional, the values can be
384379set using an environment variable with a fallback on default values in
385- the database.</ p >
380+ the database. you will be able to overwrite some odoo options. </ p >
386381< p > The configuration read from the files are visible under the
387382Configuration menu. If you are not in the ‘dev’ environment you will not
388383be able to see the values contained in the defined secret keys (by
@@ -410,7 +405,7 @@ <h1>server configuration environment files</h1>
410405</ ul >
411406</ div >
412407< div class ="section " id ="installation ">
413- < h2 > < a class ="toc-backref " href ="#toc-entry-1 "> Installation</ a > </ h2 >
408+ < h1 > < a class ="toc-backref " href ="#toc-entry-1 "> Installation</ a > </ h1 >
414409< p > By itself, this module does little. See for instance the
415410< tt class ="docutils literal "> mail_environment</ tt > addon which depends on this one to allow
416411configuring the incoming and outgoing mail servers depending on the
@@ -422,7 +417,7 @@ <h2><a class="toc-backref" href="#toc-entry-1">Installation</a></h2>
422417< tt class ="docutils literal "> SERVER_ENV_CONFIG</ tt > and < tt class ="docutils literal "> SERVER_ENV_CONFIG_SECRET</ tt > .</ p >
423418</ div >
424419< div class ="section " id ="configuration ">
425- < h2 > < a class ="toc-backref " href ="#toc-entry-2 "> Configuration</ a > </ h2 >
420+ < h1 > < a class ="toc-backref " href ="#toc-entry-2 "> Configuration</ a > </ h1 >
426421< p > To configure this module, you need to edit the main configuration file
427422of your instance, and add a directive called < tt class ="docutils literal "> running_env</ tt > . Commonly
428423used values are ‘dev’, ‘test’, ‘production’:</ p >
@@ -441,7 +436,7 @@ <h2><a class="toc-backref" href="#toc-entry-2">Configuration</a></h2>
441436< p > If you don’t provide any value, test is used as a safe default.</ p >
442437< p > You have several possibilities to set configuration values:</ p >
443438< div class ="section " id ="server-environment-files ">
444- < h3 > < a class ="toc-backref " href ="#toc-entry-3 "> server_environment_files</ a > </ h3 >
439+ < h2 > < a class ="toc-backref " href ="#toc-entry-3 "> server_environment_files</ a > </ h2 >
445440< p > You can edit the settings you need in the < tt class ="docutils literal "> server_environment_files</ tt >
446441addon. The < tt class ="docutils literal "> server_environment_files_sample</ tt > can be used as an
447442example:</ p >
@@ -452,10 +447,17 @@ <h3><a class="toc-backref" href="#toc-entry-3">server_environment_files</a></h3>
452447can override or extend default values;</ li >
453448< li > you can override or extend values in the main configuration file of
454449your instance;</ li >
450+ < li > In some platforms (like odoo.sh where production config file is copied
451+ to staging) it can be useful to overwrite options written in the
452+ < tt class ="docutils literal "> [options]</ tt > section. You must allow the override by adding
453+ < tt class ="docutils literal "> server_environment_allow_overwrite_options_section = True</ tt > to the
454+ former < tt class ="docutils literal "> odoo.cfg</ tt > config file or through the environment variable:
455+ < tt class ="docutils literal "> export SERVER_ENVIRONMENT_ALLOW_OVERWRITE_OPTIONS_SECTION=True</ tt > (if
456+ both are set config file takes precedence).</ li >
455457</ ul >
456458</ div >
457459< div class ="section " id ="environment-variable ">
458- < h3 > < a class ="toc-backref " href ="#toc-entry-4 "> Environment variable</ a > </ h3 >
460+ < h2 > < a class ="toc-backref " href ="#toc-entry-4 "> Environment variable</ a > </ h2 >
459461< p > You can define configuration in the environment variable
460462< tt class ="docutils literal "> SERVER_ENV_CONFIG</ tt > and/or < tt class ="docutils literal "> SERVER_ENV_CONFIG_SECRET</ tt > . The 2
461463variables are handled the exact same way, this is only a convenience for
@@ -505,7 +507,7 @@ <h3><a class="toc-backref" href="#toc-entry-4">Environment variable</a></h3>
505507reference records. See “USAGE”.</ blockquote >
506508</ div >
507509< div class ="section " id ="default-values ">
508- < h3 > < a class ="toc-backref " href ="#toc-entry-5 "> Default values</ a > </ h3 >
510+ < h2 > < a class ="toc-backref " href ="#toc-entry-5 "> Default values</ a > </ h2 >
509511< p > When using the < tt class ="docutils literal "> server.env.mixin</ tt > mixin, for each env-computed field,
510512a companion field < tt class ="docutils literal "> <field>_env_default</ tt > is created. This field is not
511513environment-dependent. It’s a fallback value used when no key is set in
@@ -514,15 +516,15 @@ <h3><a class="toc-backref" href="#toc-entry-5">Default values</a></h3>
514516< p > Note: empty environment keys always take precedence over default fields</ p >
515517</ div >
516518< div class ="section " id ="server-environment-integration ">
517- < h3 > < a class ="toc-backref " href ="#toc-entry-6 "> Server environment integration</ a > </ h3 >
519+ < h2 > < a class ="toc-backref " href ="#toc-entry-6 "> Server environment integration</ a > </ h2 >
518520< p > Read the documentation of the class
519521< a class ="reference external " href ="models/server_env_mixin.py "> models/server_env_mixin.py</ a > and
520522[models/server_env_tech_name_mixin.py]
521523(models/server_env_tech_name_mixin.py)</ p >
522524</ div >
523525</ div >
524526< div class ="section " id ="usage ">
525- < h2 > < a class ="toc-backref " href ="#toc-entry-7 "> Usage</ a > </ h2 >
527+ < h1 > < a class ="toc-backref " href ="#toc-entry-7 "> Usage</ a > </ h1 >
526528< p > You can include a mixin in your model and configure the env-computed
527529fields by an override of < tt class ="docutils literal "> _server_env_fields</ tt > .</ p >
528530< pre class ="literal-block ">
@@ -546,7 +548,7 @@ <h2><a class="toc-backref" href="#toc-entry-7">Usage</a></h2>
546548</ pre >
547549</ div >
548550< div class ="section " id ="known-issues-roadmap ">
549- < h2 > < a class ="toc-backref " href ="#toc-entry-8 "> Known issues / Roadmap</ a > </ h2 >
551+ < h1 > < a class ="toc-backref " href ="#toc-entry-8 "> Known issues / Roadmap</ a > </ h1 >
550552< ul class ="simple ">
551553< li > it is not possible to set the environment from the command line. A
552554configuration file must be used.</ li >
@@ -558,23 +560,23 @@ <h2><a class="toc-backref" href="#toc-entry-8">Known issues / Roadmap</a></h2>
558560</ ul >
559561</ div >
560562< div class ="section " id ="bug-tracker ">
561- < h2 > < a class ="toc-backref " href ="#toc-entry-9 "> Bug Tracker</ a > </ h2 >
563+ < h1 > < a class ="toc-backref " href ="#toc-entry-9 "> Bug Tracker</ a > </ h1 >
562564< p > Bugs are tracked on < a class ="reference external " href ="https://github.com/OCA/server-env/issues "> GitHub Issues</ a > .
563565In case of trouble, please check there if your issue has already been reported.
564566If you spotted it first, help us to smash it by providing a detailed and welcomed
565567< a class ="reference external " href ="https://github.com/OCA/server-env/issues/new?body=module:%20server_environment%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior** "> feedback</ a > .</ p >
566568< p > Do not contact contributors directly about support or help with technical issues.</ p >
567569</ div >
568570< div class ="section " id ="credits ">
569- < h2 > < a class ="toc-backref " href ="#toc-entry-10 "> Credits</ a > </ h2 >
571+ < h1 > < a class ="toc-backref " href ="#toc-entry-10 "> Credits</ a > </ h1 >
570572< div class ="section " id ="authors ">
571- < h3 > < a class ="toc-backref " href ="#toc-entry-11 "> Authors</ a > </ h3 >
573+ < h2 > < a class ="toc-backref " href ="#toc-entry-11 "> Authors</ a > </ h2 >
572574< ul class ="simple ">
573575< li > Camptocamp</ li >
574576</ ul >
575577</ div >
576578< div class ="section " id ="contributors ">
577- < h3 > < a class ="toc-backref " href ="#toc-entry-12 "> Contributors</ a > </ h3 >
579+ < h2 > < a class ="toc-backref " href ="#toc-entry-12 "> Contributors</ a > </ h2 >
578580< ul class ="simple ">
579581< li > Florent Xicluna (Wingo) << a class ="reference external " href ="mailto:florent.xicluna@gmail.com "> florent.xicluna@gmail.com</ a > ></ li >
580582< li > Nicolas Bessi << a class ="reference external " href ="mailto:nicolas.bessi@camptocamp.com "> nicolas.bessi@camptocamp.com</ a > ></ li >
@@ -591,7 +593,7 @@ <h3><a class="toc-backref" href="#toc-entry-12">Contributors</a></h3>
591593</ ul >
592594</ div >
593595< div class ="section " id ="maintainers ">
594- < h3 > < a class ="toc-backref " href ="#toc-entry-13 "> Maintainers</ a > </ h3 >
596+ < h2 > < a class ="toc-backref " href ="#toc-entry-13 "> Maintainers</ a > </ h2 >
595597< p > This module is maintained by the OCA.</ p >
596598< a class ="reference external image-reference " href ="https://odoo-community.org ">
597599< img alt ="Odoo Community Association " src ="https://odoo-community.org/logo.png " />
@@ -604,6 +606,5 @@ <h3><a class="toc-backref" href="#toc-entry-13">Maintainers</a></h3>
604606</ div >
605607</ div >
606608</ div >
607- </ div >
608609</ body >
609610</ html >
0 commit comments