Environment Variables#

class odoo_tools.env.EnvironmentVariable(serializer=None, deserializer=None, alternate_names=None, default=None, **kwargs)[source]#
class odoo_tools.env.EnvironmentVariables[source]#

EnvironmentVariables parser

property ALLOW_DANGEROUS_SETTINGS#

This environment variables allows it to set the PGPASSWORD in the environment variables. Otherwise, the entrypoint will fail to let odoo starts unless you specify this environment variable as TRUE. The reason behind that is that it’s generally not a good idea to set credentials in environment variables. Those values can be leaked easily in logs from the environment running the container or even in logs displaying environment variables anywhere. This should only be used in dev environment or test environment in which credentials are not that important.

Type:

bool

property APT_INSTALL_RECOMMENDS#

Define if you want the sudo_entrypoint to call apt-get with –no-install-recommends. By default, the entrypoint will use –no-install-recommends, but if this environment variable is set to TRUE. It will not add this parameter to apt-get install. (Default: False)

Type:

bool

property DEPLOYMENT_AREA#

Deployment Area is just an environment variable that can be set to determine if it’s a production environment or test environment.

Type:

str

property MASTER_PASSWORD#

Master password that should be set instead of the default one being automatically generated randomly.

Type:

str

property ODOO_BASE_PATH#

The base path where odoo is installed

Type:

str

property ODOO_DISABLED_MODULES#

Odoo modules that shouldn’t exist. Those would get removed from the addons paths.

Items are defined as csv values in environment variables.

Type:

Set<str>

property ODOO_EXCLUDED_PATHS#

Excluded paths will not be looked into when searching modules.

Items are defined as csv values in environment variables.

Type:

Set<Path>

property ODOO_EXTRA_APT_PACKAGES#

Set<Str> Extra apt packages to install other than the one introspected in modules.

Items are defined as csv values in environment variables.

property ODOO_EXTRA_PATHS#

Extra paths are paths to look for modules other than the default ones.

Items are defined as csv values in environment variables.

Type:

Set<Path>

property ODOO_RC#

Location of the odoo.cfg file

Type:

str

property ODOO_REQUIREMENTS_FILE#

The path in which requirements get stored during installation of pip packages required by odoo addons.

Type:

str

property ODOO_STRICT_MODE#

Run odoo in Strict Mode (Default: True)

Type:

bool

property ODOO_VERSION#

The odoo version being currently used.

Type:

str

property PACKAGE_MAP_FILE#

File storing a map of {module_name: module_renamed} to rename modules that shouldn’t be used as is.

Type:

str

property REQUIREMENTS_FILE_PATH#

Path of the requirement file to be saved. (Default: None)

Type:

str

property RESET_ACCESS_RIGHTS#

Reset access rights ensure that files in the home directory of the odoo user is set to the right user. This shouldn’t be necessary in most cases. (Default: False)

Type:

bool

property SHOW_MASTER_PASSWORD#

Log the master password in the logs.

Type:

bool

property SKIP_PIP#

Skip the installation of pip modules. (Default: False)

Type:

bool

property SKIP_POSTGRES_WAIT#

Tells to skip waiting for postgress to be up and running (Default: False)

Type:

bool

property SKIP_SUDO_ENTRYPOINT#

Skip the sudo entrypoint. The entry point is used mainly to setup things that require higher access like installing apt packages. (Default: False)

Type:

bool

property USE_ODOO_LOGGER#

Tell the app to initialize the odoo logger instead of using the default one. (Default: False)

Type:

str

classmethod fields()[source]#
values()[source]#
class odoo_tools.env.StoredBoolEnv(**kwargs)[source]#
deserializer()#

Convert a string into a bool value.

The value will be true if its a text representation that is a caseless version of ‘true’.

Any other value will be False.

Parameters:

value (str) – A text representation of a boolean. The value must be true to be true. Any other value will be interpreted as False.

Returns:

A True or False representation of the text input.

Return type:

bool

serializer()#

Convert a bool into a string value.

Parameters:

value (bool) – A boolean like value.

Returns:

A text representation of a boolean value.

Return type:

bool

class odoo_tools.env.StoredEnv(readonly=False, **kwargs)[source]#
class odoo_tools.env.StoredSetEnv(item_type=None, **kwargs)[source]#
serializer()#