OD504 circular-dependency¶
A module in depends depends back on this module.
| Category | Severity | Series | Needs the index |
|---|---|---|---|
| Correctness | Error | all | yes |
What it reports¶
An entry of the manifest's depends from which the module itself can be reached again by
following depends, directly or through other modules. Each checked module in the cycle is
reported, on the dependency that leads back to it.
Why it matters¶
Odoo installs a module after the modules it depends on, and a cycle leaves no module to start
with. Installing either one sends Odoo from each module to the other until it gives up with
Recursion error in modules dependencies!, so neither can be installed. The cycle usually
appears when two modules grow to need something from each other, and the second dependency is
added to make one import or one view work.
Example¶
{
"name": "Loyalty cards",
"version": "18.0.1.0.0",
"depends": ["sale", "loyalty_card_report"],
}
{
"name": "Loyalty card report",
"version": "18.0.1.0.0",
"depends": ["loyalty_card"],
}
Each module depends on the other.
{
"name": "Loyalty cards",
"version": "18.0.1.0.0",
"depends": ["sale"],
}
loyalty_card_report keeps its dependency on loyalty_card. Whatever loyalty_card needed
from the report moves into loyalty_card, or into a third module that both depend on.