A FastAPI-based web application that visualizes Odoo field dependency trees in a hierarchical graph format. This tool helps Odoo developers understand which fields depend on a given field based on its TriggerTree.
The project consists of two main components:
- RESTful API endpoints for receiving and serving trigger tree data
- Static file serving for CSS and frontend assets
- Jinja2 template rendering for the web interface
- HTML Template: Single-page application structure
- D3.js Visualizatio: Interactive graph rendering with zoom/pan capabilities
field_trigger_treeOdoo addon to gather field information and send tree data to FastAPI endpoint.
- Python 3.8+
- Running Odoo system (tested on Odoo version
18.0and19.0)
git clone [email protected]:rejamen/odoo_field_trigger_tree.git
cd odoo_field_trigger_treepython -m venv venv
source venv/bin/activatepip install -r requirements.txtCopy the addon form the route odoo_addon/field_trigger_tree, paste it in your Odoo addons path and install it
Once the addons is installed, activate the debug mode and search for System Parameters to set the correct IP Address of your PC where FastApi will run.
Change only the IP address, keep the port and the rest of the URL as it is
uvicorn main:app --reload --host 0.0.0.0 --port 8000The application will be available at: http://localhost:8000
Activate the Debug mode and type fields to access Settings / Technical / Database Structure / Fields.
Select any field, for example the field Name on the res.partner model and click on the button Send Trigger Tree in the header.
You should received a success message like this one:
Then open you FastApi app in another Tab in the URL shown in the message and you should see a Graph like this one:
- Zoom & Pan: Navigate large dependency trees
- Responsive Layout: Adapts to different screen sizes
- 🔴 Red Circles: Source fields (triggers)
- 🔵 Blue Circles: Relationship fields (intermediates)
- 🟢 Green Circles: Target fields (affected)
- Curved Lines: Dependency connections
- Column Layout: Hierarchical organization
- Source Field: The original field that triggers changes
- Direct Dependencies: Fields directly affected by the source
- Relationships: Intermediate relationship fields (like
partner_id) - Related Fields: Fields affected through relationships
| Method | Endpoint | Description |
|---|---|---|
GET |
/ |
Main visualization interface |
POST |
/receive-trigger-tree |
Receive trigger tree data from Odoo |
GET |
/api/trigger-tree |
Get stored trigger tree data |
odoo_field_trigger_tree/
├── main.py # FastAPI application
├── requirements.txt # Python dependencies
├── .env # Environment variables (optional)
├── .gitignore # Git ignore rules
├── templates/
│ ├── graph.html # Main visualization template
│ └── styles.css # Custom CSS styles
├── odoo_addon/
│ ├── field_trigger_tree # addon to be installed in Odoo v18 or v19
└── docs # Images for the README
└── README.md # This file
1. Connection Refused
- Ensure FastAPI server is running on port 8000
- Check firewall settings
2. No Data Displayed
- Verify trigger tree data was sent from Odoo
- Check browser console for JavaScript errors
- Confirm API endpoint returns data
3. Styling Issues
- Clear browser cache
- Ensure CSS file is loading correctly
- Check for Bootstrap conflicts
4. Odoo Integration Issues
- Verify Odoo dependencies (requests library)
- Check network connectivity between Odoo and FastAPI
- Review Odoo logs for error messages
This project is open source. Feel free to modify and distribute according to your needs.
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
This repository is part of my work in aidooit, the space I have created to learn by doing, create and share.
You can see the content I have created on my YouTube channel. If you like it, and want to support my work, please consider subscribing to my channel and sharing the content with others who might find it useful.
You can also Buy me coffee ☕ 🙏
Built with ❤️ for the Odoo developer community



