Package: odoo-analyse
odoo-analyseAnalyse tool for odoo modulesInstallationInstall the module with the ability to render graphs:aptinstallclocgraphviz
npminstall-geslintcc# required for JS complexitypip3install"odoo-analyse[graph]"Usageodoo_analyse --helpRead in modules--config /path/to/odoo.cfg.. Load modules using an odoo configuration file--path /path/to/modules.. Load modules within a directory--load /path/to/data.json.. Load the modules from a previously stored data fileOr if you want to load the file fromstdin:--load -.. Loads the data from the module analysis directly from thestdinSave the loaded modules-s /path/to/data.json.. Store the loaded modules in a fileOr if you want to output it tostdout:-s -.. Output the loaded modules tostdoutFiltering--modules '*'.. Only show modules with a matching name--models '*'.. Only show models with a matching name--views '*'.. Only show views with a matching name--path-filter '*'.. Only modules with a matching file path--test-filter.. Include module starting withtest_--estimate-state.. Estimate the state of a module (installed/uninstalled) only using dependencies and auto_install flags.--state-filter installed.. Only modules with a specific state. This connects to a database to determine the state of a module. The connection information are extracted from a configuration file or using the database parameters--full-graph.. If set all the above filters are only used for the starting nodes and not for the base modulesModule graphUse atleast one of the following--show-*options to show a module graph.--show-dependency.. Show module dependencies from the manifests--show-import.. Show imports of module from other modules--show-reference.. Show XML references of modules from other modules--migration '*'.. Color all modules with a matching versionDatabaseThese options can be used to extract instance specific information about modules such as installation state to be used in filters.--db-host host.. Host on which the database is running--db-port 5432.. Port on which the database is running--db-name odoo.. Name of the database--db-user user.. Name of the user to access the database--db-password.. If specified a password prompt will ask for the password to connect to the databaseSkippingThese options control what is analysed and can result in a faster analyse.--skip-all.. All of the below--skip-assets.. Skip analysing assets (JS, CSS, Web Templates, ...)--skip-data.. Skip analysing CSV and XML data--skip-language.. Skip analysing the lines of code--skip-python.. Skip analysing python files (controllers, models, ...)--skip-readme.. Skip reading the readme filesExamplesUsage as libraryIf you'd like to import the package and use it within a Odoo module you can add it as an import and call the options:>>>fromodoo_analyseimportOdoo>>>odoo=Odoo.from_path(".")>>>odoo["auth_session_timeout"].models{'ir.http':<Model:ir.http>,'ir.config_parameter':<Model:ir.config_parameter>,'res.users':<Model:res.users>}>>>odoo["auth_session_timeout"].manifest{"auth_session_timeout":{"path":"/x/y/z","name":"auth_session_timeout",...}}Usage as command line tool# Analyse all modules in a folder and create a module dependency graph to module.gv.pdf$odoo_analyse-p/path/to/modules--show-dependency# Analyse all available modules of an Odoo instance and save it to a json file for later usage$odoo_analyse-c/path/to/odoo.cfg-s/path/to/cache.jsonThe following examples are using a previously created cache file.# Create the dependency graph of all modules starting with `sale_`$odoo_analyse-l/path/to/cache.json--modules'sale_*'--show-dependency# Create the full dependency graph of all modules starting with `sale_`$odoo_analyse-l/path/to/cache.json--modules'sale_*'--show-dependency--full-graph# Connect to the database from the odoo.cfg and create the dependency graph of all installed modules$odoo_analyse-l/path/to/cache.json-c/path/to/odoo.cfg--state-filterinstalled--show-dependency# Estimate the state using the module dependencies and auto_install flags based on the `modules` given via stdin. Output the analysed installed modules to `analyse.json`.$catmodules.txt|odoo_analyse-podoo--modules---analyseanalyse.json--estimate-state--state-filterinstalled