Context#

class odoo_tools.api.context.Context(custom_paths=None, strict_mode=True, requirements_file_path=None, odoo_base_path=None, excluded_paths=None, exclude_odoo=False, disabled_modules=False, odoo_rc=False, include_odoo_entrypoints=True, force_addons_lookup=False, init_logger=True, run_only=False, extra_apt_packages=None, apt_install_recommends=False, package_map_file=None, skip_pip=False, skip_sudo_entrypoint=False, skip_postgres_wait=False, allow_dangerous_settings=False, odoo_version=None, master_password=None, show_master_password=True, reset_access_rights=False, requirement_file_path=None)[source]#

The context in which you use the Environment.

For example, the context will be able to load environment variables configured in the running environment.

The environment variables are then passed to the context and then the application is able to have a proper behaviour based on the environment.

strict_mode#

Can be used to run in strict mode. In strict mode, the library doesn’t ignore exceptions and raise exceptions to the caller.

This is useful in CI pipelines that may want to know in case of failure. One example is when running Pip install modules, it may complete installing but should stop in case some dependencies can’t be installed properly.

In some cases, when running a docker image, you may want your docker container to keep running even if some pip dependencies can’t be installed/upgraded.

Type:

bool

custom_paths#

A list of Path that contains modules. The path may not directly contain modules as this library can be used to find modules recursively in given paths.

Type:

Set<Path>

default_odoorc()[source]#
classmethod from_env(envvars=None)[source]#

Creates a Context from environment variables.