Skip to content
Snippets Groups Projects
README.rst 11.08 KiB

Odoo Scripts

Most commands can be run directly or with the image build from Dockerfile (xcgd/odoo_scripts) by indicating the command to run, but the best way to use this module is to install it. Installing will also install dependencies.

Scripts

Those scripts are available when installing the package, and can also be run directly.

The recommend way to install this module is to run python3 -m pip install hg+https://orus.io/xcg/odoo_scripts#egg=odoo_scripts, or to clone it then run python3 -m pip install ..

Some scripts are in other sections, because they need some specialized library, in that case you need to indicate the name of section as in python3 -m pip install "hg+https://orus.io/xcg/odoo_scripts#egg=odoo_scripts[docker]". The prerequisites for this module or one of its section can be installed by using pip3 or the package manager; the requirements are defined in setup.py.

Important

As there is no way of indicating sections (worse, it is handling them incorrectly), do not use python3 setup.py install.

docker_isort

Run dockerized isort on current directory. This uses a configuration file that is adapted to OCA guidelines for imports.

This is part of the docker section.

docker_pylint

Run dockerized pylint on provided module name. Pylint must be present in the project image.

This is part of the docker section.

docker_prettier

Run dockerized prettier on provided directory. prettier must be present in the project image.

This is part of the docker section.

conf2reST.py

This script is used to produce a reST file from setup.cfg, the Dockerfile and the .hgconf/nest.yaml file.

When the package is installed, the executable for this script is conf2reST. This is part of the conf2reST section.

update_duplicate_sources.py

This script will update a project that only contain the sources of the one it is launched from.

It expect the configuration file (setup.cfg) to have the following keys:

  • modules: list of directories and files to include (also used by another script)
  • dependencies: list of directories and files to include (also used by another script)
  • other_sources: list of directories and files to include (only used by this script, used for README, ReleaseNotes, script directories, etc.)
  • duplicate_repo: target repository, if none are specified, uses the same URL and append _sources to it.

No change are made to the name of the directories/files included.