Problem statement: Custom or third-party modules fail to install or upgrade because required dependencies are missing or not correctly declared in manifest.py, causing import errors and broken functionality.
Step 1 – Read the real error (log/CLI)
When a module fails to install, the real reason is usually in the log:
Option A – From terminal
./odoo-bin -d your_db_name -i your_module_name --log-level=debug
Watch for lines like:
Missing required dependency: module_nameKeyError: 'module_name'ModuleNotFoundError: No module named 'xyz'External ID not found in the system: module_name.view_id
Those tell you what dependency is missing.
Step 2 – Fix depends in __manifest__.py
Many install failures are because the module uses models from other modules but doesn’t list them as dependencies.
Example of a problematic __manifest__.py
# your_module/__manifest__.py
{
'name': 'Custom Sales Report',
'version': '17.0.1.0.0',
'summary': 'Custom report on sales orders',
'author': 'You',
'website': 'https://example.com',
'category': 'Sales',
'depends': ['base'], # missing 'sale' !!
'data': [
'views/sales_report_view.xml',
],
'installable': True,
'application': False,
}
But inside your Python code or XML, you’re using:
- Model:
sale.order - Views from
salemodule - Fields defined in
salemodule
So Odoo expects sale to be loaded before your module.
Corrected __manifest__.py
# your_module/__manifest__.py
{
'name': 'Custom Sales Report',
'version': '17.0.1.0.0',
'summary': 'Custom report on sales orders',
'author': 'You',
'website': 'https://example.com',
'category': 'Sales',
'depends': [
'base',
'sale', # you use sale.order
'stock', # if you use stock.move, etc.
# add here every Odoo module whose models/views you touch
],
'data': [
'security/ir.model.access.csv',
'views/sales_report_view.xml',
'report/sales_report_templates.xml',
],
'installable': True,
'application': False,
}
Rule:
Anything you import, inherit, or reference (models/views) → its module must be in depends.
Examples:
- Using
account.move→ add'account' - Using
hr.employee→ add'hr' - Extending
mrp.production→ add'mrp'
Step 3 – Ensure the dependency modules actually exist & are visible
Sometimes the dependency is correct but Odoo can’t find the module.
- Check your
odoo.conf:
[options]
addons_path = /opt/odoo/odoo/addons,/opt/odoo/custom/addons
Make sure:
- Your custom modules are in
/opt/odoo/custom/addons/your_module - Any third-party dependency module (e.g.,
web_responsive,sale_management_extra) is inside one of the paths.
- Restart Odoo after changing addons:
sudo service odoo restart
# or
./odoo-bin -d your_db_name
- In UI:
- Go to Apps → Update Apps List (click “Update Apps List”)
- Then search your dependency module and ensure it’s installable.
If the required module simply doesn’t exist, you must download/install it first.
Step 4 – Handle external Python libraries (non-Odoo deps)
If the error in logs is like:
ModuleNotFoundError: No module named 'pandas'
Then your module depends on an external Python package.
Declare it in __manifest__.py
# your_module/__manifest__.py
{
'name': 'Data Analysis Integration',
'version': '17.0.1.0.0',
'depends': ['base'],
'external_dependencies': {
'python': ['pandas', 'requests'], # external libs
},
'data': [
'views/data_analysis_view.xml',
],
'installable': True,
}
Install those packages in your environment
pip install pandas requests
# or, if using virtualenv
/path/to/venv/bin/pip install pandas requests
Restart Odoo and try to install again.
Step 5 – Check __init__.py and imports (often looks like dependency issue)
Sometimes the module “fails to install” but the root cause is a broken import in your own code.
Directory structure should look something like:
your_module/
├── __init__.py
├── __manifest__.py
├── models/
│ ├── __init__.py
│ └── sale_report.py
└── views/
└── sales_report_view.xml
your_module/__init__.py
from . import models
your_module/models/__init__.py
from . import sale_report
your_module/models/sale_report.py
from odoo import api, fields, models
class SaleOrderReport(models.Model):
_inherit = 'sale.order' # requires 'sale' in depends
custom_margin = fields.Float(string="Custom Margin")
@api.depends('amount_total', 'amount_untaxed')
def _compute_custom_margin(self):
for order in self:
order.custom_margin = order.amount_total - order.amount_untaxed
Common bugs:
- Typo in file name vs import (
from . import slae_report) - Importing a model from another module that isn’t in
depends - Circular import between modules
Step 6 – Clean upgrade/install after fixes
After you change __manifest__.py, __init__.py, or dependencies:
Option A – From UI
- Go to Apps
- Click Update Apps List
- Search your module → click Upgrade (or Install if new)
Option B – From CLI
./odoo-bin -d your_db_name -u your_module_name --log-level=debug
This forces Odoo to:
- Reload manifest
- Re-check dependencies
- Apply Python/XML updates
Quick Checklist for Your Case
When “Module Installation Fails Due to Unresolved Dependencies”:
-
Check logs → identify exact error (
missing module,missing python lib,import error). -
Fix
dependsin__manifest__.py:
-
Add all Odoo modules whose models/views you use.
- Ensure dependency modules exist:
They’re in
addons_path-
Apps list updated
- Handle external libs:
Add
external_dependencies['python']-
pip installthose packages-
Verify
__init__.py+ imports:
-
Verify
-
Correct module structure and names.
- Restart + upgrade module:
./odoo-bin -d db -u your_module_name
Conclusion – Fixing Odoo Module Installation Dependency Issues
When an Odoo module fails to install, it’s rarely “just a bug”—it’s usually a dependency problem hiding in the background. Missing or incorrect entries in manifest.py, unavailable addons, broken imports, or missing Python libraries all lead to the same result: installation failure and confusing error logs.
The good news is: once you follow a disciplined approach, these issues become easy to control:
Always declare every real dependency in depends (every model/view you inherit or reference must have its module listed).
Make sure all required modules are present in addons_path and visible in Apps.
Use external_dependencies for Python libraries and install them in the same environment Odoo runs in.
Keep your module structure (init.py, imports, models/ views) clean and consistent.
After changes, always update the apps list and upgrade the module or use -u your_module_name from CLI.
By treating the manifest file as the source of truth for dependencies and regularly checking logs during installation, you’ll avoid most “Module installation failed” surprises and make your Odoo projects much more stable and predictable.
Top comments (0)