Skip to main content

Odoo Documentation Generator

Project description

Logo

Pigeoo

Tl;dr: rarefied Doxygen for Odoo.

Automatically generates documentation for Odoo models. Give an index (index.*.html) to the inheritance tree of all Odoo classes and all Odoo modules.

Everything is static for now. The folder also contains all the information in .py files that are dicts (essentially json) that can be eval'd to be able to easily query any model.

Works for Odoo in Python 3 (so 11.0 and above).

See TODO section: this is more of a stub than a project.

Screenshot

Install

Needs python 3.8 to run* The recommended way to install is to use pipx:

pipx install --python python3.8 pigeoo

*(it uses ast, which changes from version to version. By switching to RedBaron, this requirement would be removed)

Usage

By default, it generate the documentation for Odoo, if found in .src folder. It will generate the documentation with online links (to Github/Gitlab) for all source folders, and skip it for non-source folders (e.g. pip installs). Example (generates doc based on pip installation, restricted to two 'top' modules):

pigeoo -m project_all,project_all_enterprise -p /home/user/src/project/odoo/addons,/home/user/.virtualenvs/project/lib/python3.6/site-packages/odoo/addons -o project_doc

The branches should be clean, i.e. up-to-date against the online version, so that online links work. Otherwise line numbers, or even file paths will be wrong. Unexpected things might cause arbitrary crashes, so stay clean.*

Use -h or --help to get all script arguments:

  • output_path, -o: folder for the documentation (defaults to odoo_'branch_name(s)')
  • paths, -p: paths for the Odoo addons (defaults to ~/src/odoo,~/src/enterprise)
  • local, -l: if true, the documentation contains links to the files on the filesystem.
  • modules, -m: if set, the documentation is restricted to modules in the dependency tree of the argument. Otherwise, all modules in path are processed.

Note that the path argument needs to be the absolute path (using ~ works, but relative paths don't (on the TODO list)).

*this script has been tested on all supported stable versions of Odoo. Some special cases have been added on a case by case basis depending on the codebase. An example is that there is one class which _name is not an instance of str; this needed two lines of code to tolerate that deviancy. Weird things in custom code might thus kill the script. PR/forks welcome!

TODO:

This parser is the first building block in having code assistance for Odoo. It's born from the observation that within Odoo itself, the only tool that is used is grep. As a result, sometimes a non-existing field is called, or it is called from a module which does not depend on the module defining it, etc. And with function or fields with a generic name, it's a pain to work. Code is not mere text, it's structured data. The next steps would be:

  • dynamic React frontend search (with a lightweight server)
  • style type of fields (colours, ...) etc. (for constraints? they are unreadable)
  • parse more information (decorators, args, ...)
  • get ending lineno => embed source code => get full code with inheritance for a given function (should then store this information in a database, as it would be huge)
  • IDE integration
  • ...

Comments

One goal was to keep things as minimal as possible, however the resulting code is spartan. Typing was introduced as a way to simplify reasoning about the code, however this specific project seems to go against each of its limits (support for lxml, basic algebraic data types). So it goes.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pigeoo-0.0.4.0.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pigeoo-0.0.4.0-py2.py3-none-any.whl (16.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pigeoo-0.0.4.0.tar.gz.

File metadata

  • Download URL: pigeoo-0.0.4.0.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.4.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.5

File hashes

Hashes for pigeoo-0.0.4.0.tar.gz
Algorithm Hash digest
SHA256 966b0b78981d5a35714695507b2746c2191a09b6f6bbb6d45cbc7c5d4ca75600
MD5 6986fdedeaf5201bbbbb54d8cbf0dda5
BLAKE2b-256 5791dd8ee57413cf639ff9d225621e8fe36d3637f2a2d40293b7e4d203ea69d7

See more details on using hashes here.

File details

Details for the file pigeoo-0.0.4.0-py2.py3-none-any.whl.

File metadata

  • Download URL: pigeoo-0.0.4.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.4.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.5

File hashes

Hashes for pigeoo-0.0.4.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 57e3d26f7f24d8a76dab723d3879b0898cba648fd72608b91eef06540676a090
MD5 f5b010f3b9c9d4b07e190f9b989237e0
BLAKE2b-256 f6642d05a9bd4ada942d3ebd79f37e28cb983054ce054d7935706440c167ebf9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page