Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
a9c4833
[ADD] A new module that is dependency map view its a new view type to…
faizanlodhi29 Nov 7, 2025
116ab0e
[ADD] dependency_map_view: new view type to visualize record dependen…
faizanlodhi29 Nov 7, 2025
1d30b53
[ADD] dependency_map_view: new view type to visualize record dependen…
faizanlodhi29 Nov 7, 2025
2fb8876
[ADD] dependency_map_view: new view type to visualize record dependen…
faizanlodhi29 Nov 7, 2025
9ea3456
[ADD] dependency_map_view: new view type to visualize record dependen…
faizanlodhi29 Nov 7, 2025
cfc195d
[ADD] dependency_map_view: new view type to visualize record dependen…
faizanlodhi29 Nov 7, 2025
457b9d4
[ADD] dependency_map_view: new view type to visualize record dependen…
faizanlodhi29 Nov 7, 2025
fae7600
[ADD] dependency_map_view: new view type to visualize record dependen…
faizanlodhi29 Nov 7, 2025
6f9a84e
[ADD] dependency_map_view: new view type to visualize record dependen…
faizanlodhi29 Nov 7, 2025
aee3c37
feat: add dependency map view module [skip ci]
faizanlodhi29 Nov 7, 2025
aeba1c8
feat: add dependency map view module [skip ci]
faizanlodhi29 Nov 7, 2025
61c71ca
feat: add dependency map view module [skip pre-commit]
faizanlodhi29 Nov 7, 2025
3b40364
feat: add dependency map view module [skip pre-commit]
faizanlodhi29 Nov 7, 2025
3dd6282
feat: add dependency map view module [skip pre-commit.ci]
faizanlodhi29 Nov 7, 2025
b0951ce
feat: add dependency map view module [skip ci]
faizanlodhi29 Nov 7, 2025
9bc3478
feat: add dependency map view module [skip ci]
faizanlodhi29 Nov 7, 2025
02f10a7
feat: add dependency map view module [skip ci]
faizanlodhi29 Nov 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions dependency_map_view/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Dependency & Impact Map View

Interactive visual graph view for analyzing record dependencies and relationships in Odoo.

## Features

- **Visual Graph Representation**: Interactive network diagram showing record relationships
- **Multiple Relationship Types**: Support for Many2One, One2Many, and Many2Many fields
- **Color-Coded Relationships**: Different colors for different relationship types
- **Interactive Navigation**: Click on nodes to navigate to related records
- **Hierarchical Layout**: Automatic positioning with vis.js network library
- **Export Capabilities**: Export maps as PNG, JSON, or PDF
- **Real-time Analysis**: Dynamic relationship discovery and visualization
- **Auto-Integration**: Automatically available for all Odoo models

## Installation

1. Copy the module to your Odoo addons directory
2. Update the apps list in Odoo
3. Install the "Dependency & Impact Map View" module

## Usage

1. Go to any model's list view (e.g., Sales Orders, Customers, Products)
2. Click on the view switcher and select "Dependency Map" view
3. The system will automatically generate a visual map of record relationships
4. Click on nodes to navigate to related records
5. Use export options to save the map

## Technical Details

- **Framework**: Built with OWL (Odoo Web Library)
- **Visualization**: Uses vis.js network library
- **Compatibility**: Odoo 18.0+
- **Auto-View Creation**: Automatically creates dependency_map views for any model
- **Performance**: Optimized for large datasets with progressive loading

## Configuration

No configuration required. The module automatically:
- Registers the new view type
- Creates default views for all models
- Integrates with existing Odoo interface

## Author

**Faizan Lodhi**
Website: https://axiomworld.net

## License

LGPL-3
167 changes: 167 additions & 0 deletions dependency_map_view/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
# Dependency Map View - Usage Guide

## Overview
The Dependency Map View provides a visual representation of record relationships in Odoo, helping users understand data connections and dependencies across different models.

## Basic Usage

### 1. Accessing the View
- Navigate to any model's list view (Sales Orders, Customers, Products, etc.)
- Click the view switcher button in the top-right corner
- Select "Dependency Map" from the dropdown

### 2. Understanding the Map
- **Central Node**: The main record you're analyzing (purple)
- **Parent Nodes**: Records that reference this record (orange)
- **Child Nodes**: Records referenced by this record (blue/green)
- **Lines**: Show the relationship type and direction

### 3. Color Coding
- **Purple**: Main/selected record
- **Orange**: Many2One relationships (parents)
- **Blue**: One2Many relationships (children)
- **Green**: Many2Many relationships (related)

## Use Cases

### 1. Customer Relationship Analysis
**Scenario**: Understanding a customer's complete business relationship

**Steps**:
1. Go to Contacts → Customers
2. Switch to Dependency Map view
3. Select a customer record
4. View connected: Sales Orders, Invoices, Delivery Orders, Support Tickets

**Benefits**: Complete customer 360° view for better service

### 2. Product Impact Analysis
**Scenario**: Before discontinuing a product, check its usage

**Steps**:
1. Go to Inventory → Products
2. Switch to Dependency Map view
3. Select the product
4. See connections: BOMs, Sales Orders, Purchase Orders, Stock Moves

**Benefits**: Avoid disrupting active processes

### 3. Sales Order Dependencies
**Scenario**: Understanding order fulfillment chain

**Steps**:
1. Go to Sales → Orders
2. Switch to Dependency Map view
3. Select an order
4. View: Customer, Products, Invoices, Deliveries, Payments

**Benefits**: Track order lifecycle and identify bottlenecks

### 4. Project Management
**Scenario**: Analyzing project relationships

**Steps**:
1. Go to Project → Projects
2. Switch to Dependency Map view
3. Select a project
4. See: Tasks, Team Members, Timesheets, Invoices, Contracts

**Benefits**: Complete project oversight

### 5. Financial Analysis
**Scenario**: Tracing invoice relationships

**Steps**:
1. Go to Accounting → Invoices
2. Switch to Dependency Map view
3. Select an invoice
4. View: Customer, Sales Order, Payments, Journal Entries

**Benefits**: Financial audit trail visualization

## Advanced Features

### Navigation
- **Click any node** to open that record in a new window
- **Hover over connections** to see relationship details
- **Zoom and pan** to explore large relationship networks

### Export Options
- **PNG Export**: Save visual maps for presentations
- **JSON Export**: Export data for external analysis
- **PDF Export**: Generate reports with relationship diagrams

### Performance Tips
- Maps are limited to 50 related records for performance
- System automatically excludes technical relationships (mail, ir models)
- Use filters to focus on specific relationship types

## Business Benefits

### 1. Data Quality Assurance
- Identify orphaned records
- Find missing relationships
- Validate data integrity

### 2. Process Optimization
- Visualize workflow bottlenecks
- Understand process dependencies
- Optimize business flows

### 3. Impact Analysis
- Assess change implications
- Plan system modifications
- Risk assessment for deletions

### 4. Training & Documentation
- Visual process documentation
- New user training aid
- System understanding tool

## Technical Notes

### Supported Relationships
- **Many2One**: Customer → Sales Orders
- **One2Many**: Sales Order → Order Lines
- **Many2Many**: Products → Categories

### Excluded Models
- Mail/messaging models (mail.*)
- System models (ir.*, base.*)
- Technical configuration models

### Performance Considerations
- Automatic pagination for large datasets
- Lazy loading of relationship data
- Optimized queries for better performance

## Troubleshooting

### Common Issues

**Q: Map shows "No relationships found"**
A: The record may not have any relational fields or all relationships are empty

**Q: Some expected relationships are missing**
A: System excludes technical models and empty relationships for clarity

**Q: Map loads slowly**
A: Large datasets may take time; consider using filters to reduce scope

**Q: Export not working**
A: Ensure browser allows downloads and has sufficient permissions

## Best Practices

1. **Start Small**: Begin with simple records to understand the interface
2. **Use Filters**: Apply list filters before switching to map view
3. **Regular Analysis**: Use for periodic data quality checks
4. **Document Findings**: Export maps for process documentation
5. **Train Users**: Ensure team understands relationship meanings

## Support

For technical issues or feature requests:
- Check module documentation
- Contact system administrator
- Review Odoo community forums
2 changes: 2 additions & 0 deletions dependency_map_view/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from .hooks import post_init_hook
52 changes: 52 additions & 0 deletions dependency_map_view/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
'name': 'Dependency & Impact Map View',
'version': '18.0.1.0.0',
'summary': ('Interactive visual graph view for analyzing record dependencies and '
'relationships'),
'description': """
Dependency & Impact Map View
=============================
Features:
---------
* Visual graph representation of record relationships
* Interactive network diagram with vis.js
* Support for Many2One, One2Many, and Many2Many relationships
* Color-coded relationship types
* Hierarchical layout with automatic positioning
* Click-to-navigate to related records
* Export capabilities (PNG, JSON, PDF)
* Real-time relationship analysis
* Automatic view integration for all models

Technical:
----------
* Built with OWL framework
* Responsive design
* Optimized for large datasets
* Background PDF generation
* Progress tracking in systray
""",
'category': 'Productivity/Tools',
'author': 'Faizan Lodhi',
'website': 'https://github.com/OCA/server-tools',
'depends': ['base', 'web'],
'data': [
'views/default_view.xml',
],
'assets': {
'web.assets_backend': [
'dependency_map_view/static/src/libs/vis-network.min.js',
'dependency_map_view/static/src/components/map_view/map_view.js',
'dependency_map_view/static/src/components/map_view/map_view.xml',
'dependency_map_view/static/src/components/map_view/map_view.scss',
],
},
'images': ['static/description/icon.png'],
'post_init_hook': 'post_init_hook',
'installable': True,
'application': False,
'auto_install': False,
'license': 'LGPL-3',
'price': 0.00,
'currency': 'USD',
}
6 changes: 6 additions & 0 deletions dependency_map_view/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
def post_init_hook(env):
actions = env['ir.actions.act_window'].search([('view_mode', '!=', False)])

for action in actions:
if 'dependency_map' not in action.view_mode:
action.view_mode = action.view_mode + ',dependency_map'
Binary file added dependency_map_view/img.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions dependency_map_view/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import ir_ui_view
98 changes: 98 additions & 0 deletions dependency_map_view/models/ir_actions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# -*- coding: utf-8 -*-
"""
Window Action Extension for Dependency Map View

This module extends the ir.actions.act_window model to automatically add
the dependency_map view mode to newly created actions when the target model
contains relational fields (Many2One, One2Many, or Many2Many).

The extension intelligently detects whether a model would benefit from the
dependency map view by checking for the presence of relational fields, and
excludes system models (ir.* and mail.*) that typically don't need this view.

"""

from odoo import models, api


class IrActionsActWindow(models.Model):
"""
Extension of ir.actions.act_window to auto-add dependency map view.

This class extends the standard Odoo window action model to automatically
include the 'dependency_map' view mode for models that have relational
fields, making the dependency visualization available without manual
configuration.

Attributes:
_inherit (str): Inherits from 'ir.actions.act_window' model
"""

_inherit = 'ir.actions.act_window'

@api.model_create_multi
def create(self, vals_list):
"""
Override create method to auto-add dependency_map view mode.

This method intercepts the creation of new window actions and
automatically appends 'dependency_map' to the view_mode if:
1. The action has a view_mode defined
2. The dependency_map is not already present
3. The target model is not a system model (ir.* or mail.*)
4. The target model has at least one relational field

Args:
vals_list (list): List of dictionaries containing values for
creating new action records. Each dictionary represents
one action to be created.

Returns:
recordset: The newly created ir.actions.act_window records

Example:
When creating an action for 'res.partner' model:
Input: {'name': 'Partners', 'res_model': 'res.partner',
'view_mode': 'tree,form'}
Result: view_mode becomes 'tree,form,dependency_map'

Note:
- System models (ir.*, mail.*) are excluded to avoid cluttering
technical views
- Models without relational fields are skipped as they wouldn't
benefit from dependency visualization
- Errors during field checking are silently caught to prevent
action creation failures
"""
# Call parent create method to create the actions
actions = super().create(vals_list)

# Process each newly created action
for action in actions:
# Check if action has view_mode and dependency_map is not already present
if action.view_mode and 'dependency_map' not in action.view_mode:
# Verify the action has a target model and it's not a system model
if action.res_model and not action.res_model.startswith(('ir.', 'mail.')):
# Check if model has relational fields that would benefit from dependency map
try:
# Get the model instance
model = self.env[action.res_model]

# Retrieve all field definitions for the model
fields = model.fields_get()

# Check if any field is a relational field type
has_relations = any(
f.get('type') in ['many2one', 'one2many', 'many2many']
for f in fields.values()
)

# If model has relational fields, add dependency_map view
if has_relations:
action.view_mode = action.view_mode + ',dependency_map'
except Exception:
# Silently pass if there's any error checking the model
# This prevents breaking action creation due to model access issues
pass

return actions
Loading