odoo/enterprise#81462

Created by Discuss, Maryam Kia (maki)
Merged at 508a5eac6843b0374219f4936ab1166ed028531f

Statuses:

Linked pull requests
label
odoo-dev:18.0-lazy_main_components-maki
head
a0eeda4765ea719600dbb6ad974ff49cce9ca143
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] web_studio: 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 #81327

Related to : odoo/odoo#201771