Objects#

class odoo_tools.services.objects.KeyValue(*args, **kwargs)[source]#
extend(other)[source]#
to_dict()[source]#
class odoo_tools.services.objects.ManifestProxy(*args, **kwargs)[source]#
classmethod parse(data)[source]#
property reference#
class odoo_tools.services.objects.OdooConfig(*args, **kwargs)[source]#
extend(other)[source]#
property options#
property repo#
to_dict()[source]#
property version#
class odoo_tools.services.objects.RepoConfig(*args, **kwargs)[source]#
property auth#

Tell if the repo require authentication. In some cases, you could have https repositories that require extra credentials. If auth is False, then the url will not get altered to use credentials like access token provided in a credentials store.

property branch#

the branch name to use

Type:

(str)

property commit#

the commit id to use

Type:

(str)

extend(other)[source]#
property private_key#

A private key if provided, the private key can be raw or it can be encrypted using Fernet encryption.

property ref#

Returns the proper ref to use.

By default it will try to use the following values in that order:

  • commit

  • branch

  • resolved odoo version or None

Returns:

the default ref to use.

Return type:

str | None

property repo_path#

Converts the url of the repo in a unique path.

The main reason is to provide a path that can be used as a unique identifier for the repositories. When inheriting services from an other manifests, all projects related to the same url will be inherited accordingly.

When fetching repositories, it ensure that a project a/web and b/web will not be fetched into a web folder. Or to some extent, a github.com/a/web and gitlab.com/a/web are still considered as two different projects.

Returns:

the path of the repo

Return type:

str

to_dict()[source]#
property url#

Url of the repository. The url can point to a repository using the ssh format or https format.

Type:

(str)

class odoo_tools.services.objects.ServiceManifest(*args, **kwargs)[source]#

This object represent all properties that can be set on a manifest for odoo services.

property addons#

A list of repository configuration.

Type:

(List<RepoConfig>)

property env#

A key value store of environment variables.

Type:

(KeyValue)

extend(other)[source]#

Creates a new ServiceManifest that extend the other one.

Parameters:

other (ServiceManifest) – The other manifest to inherit from.

Returns:

A new ServiceManifest

Return type:

(ServiceManifest)

get_inherited_object(key)[source]#
Returns:

Related service manifest given by its name.

Return type:

ServiceManifest

property inherit#

A reference to an other service manifest. It’s possible to reference manifests by name. In that case, a service will be able to merge its own properties with a parent manifest configuration.

For example, you may want to have a production server using the production branch of certain repositories. While a staging environment tracking the staging branch. To make things simpler, you could have all addons defined in the staging environment. But you could also define custom branches for production and keep the rest as the staging environment is using.

Type:

(ServiceManifest)

property labels#

A key value store of labels.

Type:

(KeyValue)

property name#

A string representing the name of the service configuration. For example, you may want to define a service staging and production with different settings.

Type:

(String)

property odoo#

A field referencing an odoo configuration.

Type:

(OdooConfig)

property resolved#

This service manifest with all of its properties resolved against the inherit property.

For example, if you had a service that inherits from an other one and each of them had different addons configured. It would let you combine all configurations together.

The value of this property would be a new ServiceManifest that has all addons of self and of inherit (recursively).

Returns:

ServiceManifest that is an extension of inherit

Return type:

ServiceManifest

resolved_prop(prop_name)[source]#
to_dict()[source]#

Returns a dict representing the data in this object.

Returns:

Dict containing all properties of this object.

Return type:

dict

class odoo_tools.services.objects.ServiceManifests(data)[source]#
property services#

Dictionary of service manifest by their name

Type:

(dict)

to_dict()[source]#

Returns a dict representing the data in this object.

Returns:

Dict containing all properties of this object.

Return type:

dict

exception odoo_tools.services.objects.ValidationError[source]#
class odoo_tools.services.objects.Version(since, until=None)[source]#