odoo-tools-grap


Nameodoo-tools-grap JSON
Version 1.3.6 PyPI version JSON
download
home_pagehttps://gitlab.com/grap-rhone-alpes/odoo-tools-grap
SummarySmall CLI tool for Odoo
upload_time2025-10-15 20:47:03
maintainerSylvain LE GAL
docs_urlNone
authorSylvain LE GAL
requires_python<4.0,>=3.9
licenseAGPLv3+
keywords cli odoo grap
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # odoo-tools-grap

[![License: AGPL v3](https://img.shields.io/badge/License-AGPL_v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)

![PyPI - Python Version](https://img.shields.io/pypi/pyversions/odoo-tools-grap)
![PyPI - Downloads](https://img.shields.io/pypi/dm/odoo-tools-grap)
![GitLab last commit](https://img.shields.io/gitlab/last-commit/34780558)
![GitLab stars](https://img.shields.io/gitlab/stars/34780558?style=social)

This tools provide extra cli commands to simplify recurring operations for Odoo developers.

- To develop and contribute to the library, refer to the `DEVELOP.md` file.
- Refer to the `ROADMAP.md` file to see the current limitation, bugs, and task to do.
- See authors in the `CONTRIBUTORS.md` file.

## Table of Contents

- [Installation](#installation)
- [Usage](#usage)
  - [Command `diff` (View repositories status)](#command-diff)
  - [Command `generate` (Generate Odoo config File)](#command-generate)
  - [Command `create-branch` (Create new Orphan Branch)](#command-create-branch)
  - [Command: `migrate` (Migrate module from a version to another)](#command-migrate)
- [Prerequites](#prerequites)
- [Credits](#credits)

<a name="installation"></a>

## Installation

The library is available on [PyPI](https://pypi.org/project/odoo-tools-grap/).

To install it simply run :

```console
# console
pipx install odoo-tools-grap
```

```bash
# bash
pipx install odoo-tools-grap
```

```shell
# shell
pipx install odoo-tools-grap
```

(See alternative installation in `DEVELOP.md` file.)

<a name="usage"></a>

## Usage

**Note:**

The term `odoo-tools-grap` can be replaced by `otg` in all the command lines below.

<a name="command-diff"></a>

### Command: `diff` (View repositories status)

Based on a repos config file (`repos.yml file`, used by gitaggregate by
exemple), this script will display the result of the `git diff` for each
repository.

```console
odoo-tools-grap diff --config repos.yml
```

#### Result Sample

```log
2024-03-27 16:37:24.725 | WARNING  | odoo_tools_grap.cli.cli_diff:diff:31 - [BAD BRANCH] ./src/OCA/product-attribute is on 16.0-product_pricelist_simulation-various-fixes.(Should be on 16.0-current)
2024-03-27 16:37:25.395 | WARNING  | odoo_tools_grap.cli.cli_diff:diff:38 - [LOCAL CHANGES] ./src/OCA/sale-workflow has 1 local changes.
2024-03-27 16:37:25.444 | WARNING  | odoo_tools_grap.cli.cli_diff:diff:43 - [UNTRACKED] ./src/OCA/sale-workflow has 2 untracked files.
```

<a name="command-generate"></a>

### Command: `generate` (Generate Odoo config File)

Base on a repos config file, (`repos.yml file`, used by gitaggregate by exemple),
and template(s) of odoo config file, this script will generate a complete config file for Odoo
with addons_path depending on the repos config file.

```console
odoo-tools-grap generate\
    --config repos.yml\
    --input-files ./template.config.cfg\
    --output-file ./odoo.cfg
```

<a name="command-create-branch"></a>

### Command: `create-branch` (Create new Orphan Branch)

This command will:

- create a new orphan target version
- add a `copier-answers.yml` file base on the previous copier answers in the initial version and commit it
- Adapt copier answers to new GRAP conventions
- Ask for copier answers. (At this step, answer default value to all questions)
- Run pre-commit
- Push the new branch on github

Before using this command, clone your repo in the previous existing branch.
for exemple:

```console
git clone git@github.com:grap/grap-odoo-custom --origin=grap --branch 12.0
cd grap-odoo-custom
```

Example:

```console
odoo-tools-grap create-branch\
    --initial-version 12.0\
    --target-version 16.0\
    --remote grap\
    --copier-url https://github.com/grap/oca-addons-repo-template-v16
```

<a name="command-migrate"></a>

### Command: `migrate` (Migrate module from a version to another)

This command will:

- Pull the last commits of the initial version
- Pull the last commits of the target version
- Create a new branch named for the module to migrate
- Cherry pick commits of the module to migrate. See [OCA Documentation](https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-16.0#technical-method-to-migrate-a-module-from-150-to-160-branch)
- Eventually merge neighboring commits. (if the commit contains --fixup, or have the same name)
- Run pre-commit and commit changes
- Call [odoo-module-migrate](https://github.com/OCA/odoo-module-migrator)
- (At this step, please note warning and error that should be fixed in a second step)
- Commit changes
- Push the new branch on github
- Create a new draft Pull Request

Before using this command:

- you should be in the folder of the repository. (created with `create-branch` command.)
- having added your personal remote with
  `git remote add YOUR-GITHUB-ACCOUNT git@github.com:YOUR-GITHUB-ACCOUNT/grap-odoo-custom`

```console
odoo-tools-grap migrate\
    --initial-version 12.0\
    --target-version 16.0\
    --modules grap_cooperative\
    --distant-remote grap\
    --local-remote YOUR-GITHUB-ACCOUNT\
    --github-token-file ABSOLUTE-PATH-TO-A-FILE-THAT-CONTAINS-GITHUB-TOKEN
```

<a name="prerequites"></a>

## Prerequites

To understand this tool:

- You need to know the following tools:
  - `gitaggregate` tools (https://github.com/acsone/git-aggregator)
  - `odoo-module-migrate` tools (https://github.com/OCA/odoo-module-migrator)
- Understand the [OCA migration process](https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-17.0#technical-method-to-migrate-a-module-from-160-to-170-branch)

<a name="credits"></a>

## Credits

### Authors

- GRAP, Groupement Régional Alimentaire de Proximité (http://www.grap.coop)

### Contributors

- Sylvain LE GAL, from GRAP (http://www.grap.coop)

            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.com/grap-rhone-alpes/odoo-tools-grap",
    "name": "odoo-tools-grap",
    "maintainer": "Sylvain LE GAL",
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": "sylvain.legal@grap.coop",
    "keywords": "cli, odoo, GRAP",
    "author": "Sylvain LE GAL",
    "author_email": "sylvain.legal@grap.coop",
    "download_url": "https://files.pythonhosted.org/packages/e0/14/e22fdc84cdda6ca12b76d4b8592c9a1e6674c71c5fa36ebe8ec2a97f0155/odoo_tools_grap-1.3.6.tar.gz",
    "platform": null,
    "description": "# odoo-tools-grap\n\n[![License: AGPL v3](https://img.shields.io/badge/License-AGPL_v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)\n\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/odoo-tools-grap)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/odoo-tools-grap)\n![GitLab last commit](https://img.shields.io/gitlab/last-commit/34780558)\n![GitLab stars](https://img.shields.io/gitlab/stars/34780558?style=social)\n\nThis tools provide extra cli commands to simplify recurring operations for Odoo developers.\n\n- To develop and contribute to the library, refer to the `DEVELOP.md` file.\n- Refer to the `ROADMAP.md` file to see the current limitation, bugs, and task to do.\n- See authors in the `CONTRIBUTORS.md` file.\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Command `diff` (View repositories status)](#command-diff)\n  - [Command `generate` (Generate Odoo config File)](#command-generate)\n  - [Command `create-branch` (Create new Orphan Branch)](#command-create-branch)\n  - [Command: `migrate` (Migrate module from a version to another)](#command-migrate)\n- [Prerequites](#prerequites)\n- [Credits](#credits)\n\n<a name=\"installation\"></a>\n\n## Installation\n\nThe library is available on [PyPI](https://pypi.org/project/odoo-tools-grap/).\n\nTo install it simply run :\n\n```console\n# console\npipx install odoo-tools-grap\n```\n\n```bash\n# bash\npipx install odoo-tools-grap\n```\n\n```shell\n# shell\npipx install odoo-tools-grap\n```\n\n(See alternative installation in `DEVELOP.md` file.)\n\n<a name=\"usage\"></a>\n\n## Usage\n\n**Note:**\n\nThe term `odoo-tools-grap` can be replaced by `otg` in all the command lines below.\n\n<a name=\"command-diff\"></a>\n\n### Command: `diff` (View repositories status)\n\nBased on a repos config file (`repos.yml file`, used by gitaggregate by\nexemple), this script will display the result of the `git diff` for each\nrepository.\n\n```console\nodoo-tools-grap diff --config repos.yml\n```\n\n#### Result Sample\n\n```log\n2024-03-27 16:37:24.725 | WARNING  | odoo_tools_grap.cli.cli_diff:diff:31 - [BAD BRANCH] ./src/OCA/product-attribute is on 16.0-product_pricelist_simulation-various-fixes.(Should be on 16.0-current)\n2024-03-27 16:37:25.395 | WARNING  | odoo_tools_grap.cli.cli_diff:diff:38 - [LOCAL CHANGES] ./src/OCA/sale-workflow has 1 local changes.\n2024-03-27 16:37:25.444 | WARNING  | odoo_tools_grap.cli.cli_diff:diff:43 - [UNTRACKED] ./src/OCA/sale-workflow has 2 untracked files.\n```\n\n<a name=\"command-generate\"></a>\n\n### Command: `generate` (Generate Odoo config File)\n\nBase on a repos config file, (`repos.yml file`, used by gitaggregate by exemple),\nand template(s) of odoo config file, this script will generate a complete config file for Odoo\nwith addons_path depending on the repos config file.\n\n```console\nodoo-tools-grap generate\\\n    --config repos.yml\\\n    --input-files ./template.config.cfg\\\n    --output-file ./odoo.cfg\n```\n\n<a name=\"command-create-branch\"></a>\n\n### Command: `create-branch` (Create new Orphan Branch)\n\nThis command will:\n\n- create a new orphan target version\n- add a `copier-answers.yml` file base on the previous copier answers in the initial version and commit it\n- Adapt copier answers to new GRAP conventions\n- Ask for copier answers. (At this step, answer default value to all questions)\n- Run pre-commit\n- Push the new branch on github\n\nBefore using this command, clone your repo in the previous existing branch.\nfor exemple:\n\n```console\ngit clone git@github.com:grap/grap-odoo-custom --origin=grap --branch 12.0\ncd grap-odoo-custom\n```\n\nExample:\n\n```console\nodoo-tools-grap create-branch\\\n    --initial-version 12.0\\\n    --target-version 16.0\\\n    --remote grap\\\n    --copier-url https://github.com/grap/oca-addons-repo-template-v16\n```\n\n<a name=\"command-migrate\"></a>\n\n### Command: `migrate` (Migrate module from a version to another)\n\nThis command will:\n\n- Pull the last commits of the initial version\n- Pull the last commits of the target version\n- Create a new branch named for the module to migrate\n- Cherry pick commits of the module to migrate. See [OCA Documentation](https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-16.0#technical-method-to-migrate-a-module-from-150-to-160-branch)\n- Eventually merge neighboring commits. (if the commit contains --fixup, or have the same name)\n- Run pre-commit and commit changes\n- Call [odoo-module-migrate](https://github.com/OCA/odoo-module-migrator)\n- (At this step, please note warning and error that should be fixed in a second step)\n- Commit changes\n- Push the new branch on github\n- Create a new draft Pull Request\n\nBefore using this command:\n\n- you should be in the folder of the repository. (created with `create-branch` command.)\n- having added your personal remote with\n  `git remote add YOUR-GITHUB-ACCOUNT git@github.com:YOUR-GITHUB-ACCOUNT/grap-odoo-custom`\n\n```console\nodoo-tools-grap migrate\\\n    --initial-version 12.0\\\n    --target-version 16.0\\\n    --modules grap_cooperative\\\n    --distant-remote grap\\\n    --local-remote YOUR-GITHUB-ACCOUNT\\\n    --github-token-file ABSOLUTE-PATH-TO-A-FILE-THAT-CONTAINS-GITHUB-TOKEN\n```\n\n<a name=\"prerequites\"></a>\n\n## Prerequites\n\nTo understand this tool:\n\n- You need to know the following tools:\n  - `gitaggregate` tools (https://github.com/acsone/git-aggregator)\n  - `odoo-module-migrate` tools (https://github.com/OCA/odoo-module-migrator)\n- Understand the [OCA migration process](https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-17.0#technical-method-to-migrate-a-module-from-160-to-170-branch)\n\n<a name=\"credits\"></a>\n\n## Credits\n\n### Authors\n\n- GRAP, Groupement R\u00e9gional Alimentaire de Proximit\u00e9 (http://www.grap.coop)\n\n### Contributors\n\n- Sylvain LE GAL, from GRAP (http://www.grap.coop)\n",
    "bugtrack_url": null,
    "license": "AGPLv3+",
    "summary": "Small CLI tool for Odoo",
    "version": "1.3.6",
    "project_urls": {
        "Homepage": "https://gitlab.com/grap-rhone-alpes/odoo-tools-grap",
        "Repository": "https://gitlab.com/grap-rhone-alpes/odoo-tools-grap"
    },
    "split_keywords": [
        "cli",
        " odoo",
        " grap"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d100f1bfa3ead10b12552a538d8d6d8069eeab83ed98bca71126b5bd7b33b481",
                "md5": "f10cdc89f581400ddd0960a2d9c6af8a",
                "sha256": "13c50cfc481737671044c4c0768dc4b65ce1236ab085ca55d3c2c5c4c617e377"
            },
            "downloads": -1,
            "filename": "odoo_tools_grap-1.3.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f10cdc89f581400ddd0960a2d9c6af8a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 11440,
            "upload_time": "2025-10-15T20:47:02",
            "upload_time_iso_8601": "2025-10-15T20:47:02.394418Z",
            "url": "https://files.pythonhosted.org/packages/d1/00/f1bfa3ead10b12552a538d8d6d8069eeab83ed98bca71126b5bd7b33b481/odoo_tools_grap-1.3.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e014e22fdc84cdda6ca12b76d4b8592c9a1e6674c71c5fa36ebe8ec2a97f0155",
                "md5": "748a8799aab537598019f396841455e6",
                "sha256": "2dbad90633f10e53390ee9abcb75ef89b6a77e095ca2ea1ae7608bee7018f69f"
            },
            "downloads": -1,
            "filename": "odoo_tools_grap-1.3.6.tar.gz",
            "has_sig": false,
            "md5_digest": "748a8799aab537598019f396841455e6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 9884,
            "upload_time": "2025-10-15T20:47:03",
            "upload_time_iso_8601": "2025-10-15T20:47:03.519311Z",
            "url": "https://files.pythonhosted.org/packages/e0/14/e22fdc84cdda6ca12b76d4b8592c9a1e6674c71c5fa36ebe8ec2a97f0155/odoo_tools_grap-1.3.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-15 20:47:03",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "grap-rhone-alpes",
    "gitlab_project": "odoo-tools-grap",
    "lcname": "odoo-tools-grap"
}
        
Elapsed time: 2.27451s