component
Provides the foundational component framework for Odoo connectors, enabling dynamic, decoupled services resolved by usage, collection, and model.
Key Features
- component: Provides an abstract component base class with helper APIs for retrieving other components by usage or name while honoring collection and model constraints.
- component registry: Maintains a per-database cache of component classes and resolves the best match using collection, usage, and target model priorities.
- component.builder: Rebuilds the global component registry at registry load so installed modules register their component classes automatically.
- collection.base: Supplies a context manager that spawns a work environment for a collection so components share the same Odoo environment and propagated attributes.
- work context: Carries the active collection, model, and custom attributes while offering APIs to spawn derived contexts and fetch matching components.
- exceptions: Defines explicit errors for missing, ambiguous, or unavailable components to guard lookups before and during registry initialization.
- utils: Exposes helpers to fetch the current component registry and check whether it is ready for use.