odoo/odoo#201771

Created by Discuss, Maryam Kia (maki)
Merged at 7743937a61545c03127aacb1cb19aa08d0379c72

Statuses:

Linked pull requests
label
odoo-dev:18.0-lazy_main_components-maki
head
defc98b989763d79c92c72920efe19ad76a97695
merged
4 months ago by Discuss, Alexandre Kühn (aku)
odoo/odoo odoo/enterprise
18.0 #201771 #81462
saas-18.1 #201897 #81517
saas-18.2 #201915 #81526

[IMP] mail: registering main components via services

When we create a public root, we do:
- Create env
- Wait for services to load
- Create MainComponentsContainer

In a usual scenario, all the services are started in the second step above, so when we create the MainComponentsContainer, all the services we need are already
available. The problem with the lazy loading chatter bundle is that one of the
services in the second step is responsible for loading that bundle. So while
the lazy bundle is loading, new services and main components are being added to
the registry.

The steps could become like this:
- Create env
- Wait for services to start
- Start loading chatter bundle
- Lazy services (from chatter bundle) are not yet completely started
- Main components of the lazy bundle are added to the registry
- Lazy services are completely started

It might cause a crash due to unavailable services when the main components are added depends on the timing of the deployment of the lazy services.

This PR defines a new service for each main component that are added through the
chatter bundle to ensure that main components are registered when their
dependent services are deployed.

backport of #201504

Related to: odoo/enterprise#81462