Contributors mailing list archives

contributors@odoo-community.org

Browse archives

Avatar

Re: Odoo automatic code documentation

by
Akretion France., David BEAL
- 24/06/2021 17:02:55
Hi,

You may probably use https://github.com/acsone/click-odoo and build your own python package.


Specifically about Odoo, we could imagine generating functional documentation coming from code split by models.
We all have a lot of custom code in our projects.

There is a major problem with custom code:
Your colleagues who know odoo perfectly and are aware of OCA modules don't know the specificity of your project.
Then to quickly dive into your project, it could be sufficient to read documentation from the custom part of the project.

But as you know, documentation lies, not the code.

So if functional doc is near the code (then attached to a model), then it could be easier to be updated.

Everybody could win: consultant and customer.

My 2 cts

Regards

David BEAL
Consultant ERP Odoo


Le jeu. 24 juin 2021 à 15:17, Daniel Reis <dreis@opensourceintegrators.com> a écrit :
Hello,

Try "cd /path/to/odoo && pip install ."
You will then be able to "import odoo"

Thanks
Daniel

On 24/06/2021 09:42, Joerg Lorenz wrote:
Hi Guys, today we are asking for your insightfullness.
Our quest:  how the python code of odoo can be automatically documented from the code itself. 

But the approach with the various toos that there are fails:  

We have tested: 
  • pdoc, a simple Python 3 command line tool and library to auto-generate API documentation for Python modules. Supports Numpydoc / Google-style docstrings, doctests, reST directives, PEP 484 type annotations, custom templates ...

  • pdoc3, a fork of pdoc for Python 3 with support for Numpydoc / Google-style docstrings, doctests, LaTeX math, reST directives, PEP 484 type annotations, custom templates ...

  • PyDoc, a documentation browser (in HTML) and/or an off-line reference manual. Also in the standard library as pydoc.

  • pydoctor, a replacement for now inactive Epydoc, born for the needs of Twisted project.

and all of them fail.  It has to do that odoo as such is not a python module itself and thus cannot be imported. 

problem in models/res_company.py - <type 'exceptions.ImportError'>: No module named odoo

If anyone has some experience, ideas, or pointer towards a solution, it would be highly appreaciated. 

Best, Joe

_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe


--
Daniel Reis
Managing Director
M: +351 919991307
E: DReis@OpenSourceIntegrators.com
Av. Republica 3000, Edificio Estoril Office, B Piso 3 - 34 • 2649-517 Alcabideche, Portugal


_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe

Reference