Skip to content

Instantly share code, notes, and snippets.

Last active August 18, 2022 14:21
  • Star 6 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Odoo module dependency graph
WITH recursive dep_tree AS (
SELECT,, NULL::integer, 1 AS level, array[] AS path_info
FROM ir_module_module mdl0
WHERE name = 'sale' -- state here the child module
SELECT (SELECT FROM ir_module_module mdl1 WHERE =, rpad('', p.level * 1, '_') ||, c.module_id, p.level + 1, p.path_info||
FROM ir_module_module_dependency c
JOIN dep_tree p ON c.module_id =
WHERE level < 5 -- define here the levels to be displayed
SELECT level, name
FROM dep_tree
ORDER BY path_info;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment