ylhc_dynamic_dependency
by YLHC Technology https://www.ylhctec.com , co. https://www.ylhctec.com , ltd. https://www.ylhctec.com$ 21.91
YLHC Dynamic Dependency is a lightweight, headless engine that keeps Odoo 19 from crashing at startup when a module inherits a model — or references one through a relational field — without declaring that module in its manifest. Undeclared dependencies are discovered while modules load, recorded, and injected into the module graph so the provider is always loaded first. No XML, no manifest editing, no restart dance: install it once and forget about it.
Why YLHC Dynamic Dependency?
No More CrashesSay goodbye to TypeError: Model ... inherits from non-existing model ... on first boot. |
Auto DiscoveryEvery undeclared _inherit / _inherits and every relational-field reference is detected at load time. |
Guaranteed OrderRecorded edges are injected into the module graph, so the provider module always loads before its inheritors. |
Clear ErrorsWhen a provider is genuinely missing you get an explicit message, not a cryptic registry failure. |
How It Works
- Detect — while each module loads, the engine resolves both inheritance providers and the modules behind relational fields (many2one / one2many / many2many comodels).
- Record — any dependency that was not declared in the manifest is persisted, so it is never lost between restarts.
- Load on the spot — if the provider is scheduled in the current pass but has not loaded yet, its models are loaded just in time, so even the very first startup succeeds.
- Inject — on every later restart the recorded edges are added to the module graph, guaranteeing the provider loads first; models carrying manual (state='manual') relational fields are sorted after their comodel providers too.
Key Features
- ✓ Inheritance aware — auto-detects undeclared _inherit and _inherits targets.
- ✓ Relation-field aware — follows comodel references to the module that provides them.
- ✓ Just-in-time model loading — first-run startups complete without a second pass.
- ✓ Restart-safe ordering — discovered dependencies persist and replay on every boot.
- ✓ Manual-field handling — keeps runtime-generated relational fields loadable.
- ✓ Explicit diagnostics — a missing provider is reported in plain terms.
- ✓ Zero configuration — depends only on base, installs right after it, and needs nothing else.
Under the Hood
The engines this keeps running — visual builders and runtime-generated models create views and fields across module boundaries; this module quietly guarantees they all load in the right order, every restart.
Good to Know
- Free and lightweight — released under LGPL-3, it is a headless helper with no end-user screens.
- Install once — it registers immediately after base so its hooks are active before other modules load.
- Auditable — administrators can review every recorded dependency under Settings → Technical → Dynamic Dependencies.
- Make it permanent — to bake a discovered dependency in for good, add the provider to that module's manifest depends.
- Designed to pair with ylhc_dynamic_fields, which creates relational fields at runtime that must load after their comodel providers.
Nothing to maintain. Declare what you want, inherit what you need — the load order takes care of itself.
Recommended YLHC Modules
ylhc_dynamic_fieldsGenerate real Odoo fields and views automatically from your data — the runtime companion this engine keeps loadable. |
ylhc_studioA visual design center for building models, views and fields without writing XML. |
ylhc_listTurn any list view into a configurable, spreadsheet-like workspace. |
ylhc_reportDesign print and PDF reports visually with drag-and-drop data binding. |
Support
Contact us at www.ylhctec.com.
© YLHC Technology, co., ltd.
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Lines of code | 367 |
| Technical Name |
ylhc_dynamic_dependency |
| License | LGPL-3 |
| Website | https://www.ylhctec.com |
Please log in to comment on this module