-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Odoo Development Cookbook
By :

The odoo-bin
script has dozens of options, and it is tedious to remember them all, as well as how to remember to set them properly when starting the server. Fortunately, it is possible to store them all in a configuration file and only specify the ones you want to alter for development, for example.
For this recipe, perform the following steps:
$ ./odoo-bin --save --config myodoo.cfg --stop-after-init
$ ./odoo-bin --help | less
This will provide you with some help about what the various options perform.
--without-demo
will become without_demo
. This works for most options, but there are a few exceptions, all of which are listed in the following section.myodoo.cfg
file (use the table in the following section for some parameters you may want to change). Then, to start the server with the saved options, run the following command:$ ./odoo-bin -c myodoo.cfg
Note
The --config
option is commonly abbreviated as -c
.
At startup, Odoo loads its configuration in three passes. First, a set of default values for all options is initialized from the source code. After, the configuration is parsed, and then any value that’s defined in the file overrides the defaults. Finally, the command-line options are analyzed, and their values override the configuration that was obtained from the previous pass.
As we mentioned earlier, the names of the configuration variables can be found by looking at the names of the command-line options by removing the leading dashes and converting the middle dashes into underscores. There are a few exceptions to this, notably the following:
Table 1.1 – Difference in Odoo parameters regarding the command line and the configuration file
Here’s a list of options that are commonly set through the configuration file:
Table 1.2 – Odoo parameters and their usage
Here’s a list of configuration options related to the database:
Table 1.3 – Odoo parameters and their usage
The configuration file is parsed by Odoo using the Python ConfigParser
module. However, the implementation in Odoo 11.0 has changed, and it is no longer possible to use variable interpolation. So, if you are used to defining values for variables from the values of other variables using the %(section.variable)s
notation, you will need to change your habits and revert to explicit values.
Some options are not used in config files, but they are widely used during development:
Table 1.4 – Odoo parameters and their usage