Skip to content

camptocamp/odoo-project-tools

Repository files navigation

Odoo Project Tools

pre-commit tests License: AGPL v3 Ruff ty

Installation

This repository contains helper tasks for working with Camptocamp Odoo projects.

Install with uv (recommended):

uv tool install git+https://github.com/camptocamp/odoo-project-tools

Install with pipx:

pipx install git+https://github.com/camptocamp/odoo-project-tools

You may need to have some build dependencies installed:

sudo apt install pipx git libpq-dev gcc python3-dev

Usage

Note: information below is subject to change.

The package brings the following commands.

otools-project: manage project

otools-pending: manage pending merges

otools-release: bump releases

otools-addon: tools to work with addons and test requirements

otools-submodule: manage submodules

otools-tasks: access to the "old" invoke tasks, yet to be rewritten

otools-ba: tools for functional people, see documentation.

otools-pr: tools to test pull request on a local odoo running a database dump, see documentation.

otools-db: tools to manage local databases

otools-cloud: tools to interact with the cloud platform

otools-i18n: tools to manage internationalization (i18n)

Use --help to get the list of subcommands.

otools-project

Use the init command to initialize a new project to use these tools.

Example:

otools-project init

This will create all configuration files that must be added to the project.

otools-pending

Tool for managing pending merges and performing git aggregations on repositories. It includes commands for listing pull requests, aggregating branches, and adding or removing pending merges.

Commands: - show: List pull requests for specified repositories or all repositories in the pending folder. Supports filtering by state and purging closed or merged pull requests. - aggregate: Perform a git aggregation on a specified repository and push the result to a remote branch if desired. - add: Add a pending merge using a given entity URL. Optionally, run git aggregation or add a patch to the pending merge. - remove: Remove a pending merge using a given entity URL. Optionally, run git aggregation after removal.

Run otools-pending $cmd --help to know more about the options.

otools-release

Tool for preparing a release.

It takes care of:

  • bumping the version
  • update changelog
  • update migration file

Run otools-release bump --help to know more about the options.

otools-addon

NOTE: this tool is meant to be used mostly for future project versions where we'll have all modules installed via pip.

The most handy feature at the moment is: otools-addon add-req.

It allows to add requiments and test requirements on the fly to an existing req file.

Example:

otools-addon add-req edi_oca -v 18 -p $pr_ref -f test-requirements.txt

This will add the test dependency in the right way to the given file.

otools-db

Usage: otools-db [OPTIONS] COMMAND [ARGS]...

  Database management commands.

Options:
  --debug
  --help   Show this message and exit.

Commands:
  dump           Create a PostgreSQL dump of the specified database.
  list           List all databases in the container.
  list-versions  Print a table of DBs with Marabunta version and install...
  restore        Restore an odoo backup locally (sql, dump or zip archive)

otools-cloud

Tools to interact with the cloud platform.

otools-cloud dump

Tools to interact with the cloud platform database dumps.

Usage: otools-cloud dump [OPTIONS] COMMAND [ARGS]...

  Cloud platform dump management commands.

Options:
  --help  Show this message and exit.

Commands:
  create             Generate a new dump on the cloud platform.
  download           Download a dump from the cloud platform.
  list               List available dumps on the cloud platform.
  restore            Restore an uploaded dump on the cloud platform.
  upload             Upload a dump file to the cloud platform.
Download a dump and restore it locally
otools-cloud dump download --env prod --restore-to-db odoodb

Optionally, specify exactly the dump to download:

otools-cloud dump download --env prod --name celebrimbor-database-name.pg.gpg --restore-to-db odoodb
Dump a local database and upload it to the cloud platform
otools-cloud dump upload --from-db odoodb --env labs.my-lab

otools-i18n

Tools to manage internationalization (i18n).

Usage: otools-i18n [OPTIONS] COMMAND [ARGS]...

  Internationalization (i18n) commands.

Options:
  --help  Show this message and exit.

Export translation files

otools-i18n export odoo/addons/module1 odoo/addons/module2 --languages fr_FR,de_DE

This will export the translation files for the given modules and languages.

The --export-pot option can be used to also export the pot file for the given modules.

About

Tooling to work with odoo projects at Camptocamp

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages