Skip to main content

Runner tool to run Odoo project using pew virtualenvs

Project description

odooquickrun

A simple command-line tool to manage Odoo projects using a pew-managed virtual environment.

๐Ÿ“ฆ Installation

Install directly from GitHub or your local source:

pip install odooquickrun

โŒ Uninstallation

To remove the tool:

pip uninstall odooquickrun

๐Ÿš€ Usage

Prerequisite: Ensure you have created and activated the pew virtual environment for your project before running these commands.

๐Ÿ“‹ Init a New Project

Scaffold a new Odoo project with the standard layout and clone Odoo source code.

odooquickrun init <project_name> [-v <version>] [--no-squash]
  • -v / --version: Odoo version branch to clone (default: 19.0).
  • --no-squash: Clone full git history instead of shallow (depth=1).

This creates:

<project_name>/
โ”œโ”€โ”€ addons/requirements.txt
โ”œโ”€โ”€ config/dev.conf
โ”œโ”€โ”€ project/requirements.txt
โ”œโ”€โ”€ odoo/              โ† cloned from GitHub
โ””โ”€โ”€ .gitignore

๐Ÿ–ฅ๏ธ Odoo Server Operations

Start Odoo

odooquickrun start

Start in Debug Mode Running with debugpy on port 5678.

odooquickrun debug

Upgrade Modules Update specific modules in a database.

odooquickrun upgrade -d <db_name> -m <module1,module2,...>
  • -d: Database name.
  • -m: Comma-separated list of modules to upgrade.

๐Ÿ—„๏ธ Database Operations

You can manage your local PostgreSQL databases directly using the db command.

Note: The default database port is 5432. You can specify a custom port for any of the commands below using the --db-port <port> option.

1. Database Management

List all databases (shows owner and size)

odooquickrun db info

Drop databases Delete one or multiple databases.

odooquickrun db drop <db1,db2,...> [options]
  • <db1,db2,...>: Comma-separated list of database names (e.g., test_db,demo_db).
  • -f / --force: Skip confirmation prompt (useful for automation).

2. User (Role) Management

List all users (shows superuser & createdb status)

odooquickrun db list_users

Create a new user Creates a user with CREATEDB permission (required for Odoo to create its own databases).

odooquickrun db create_user <username> <password>

Drop a user Permanently delete a postgres user/role.

odooquickrun db drop_user <username> [-f]

3. Database Cleaning

Execute a SQL cleaning script Run a .sql file against a database (e.g., for data anonymization or cleanup).

odooquickrun db clean <database> -f <path/to/file.sql> [--force]
  • -f / --file: Path to the SQL file to execute (required).
  • --force: Skip confirmation prompt.

๐Ÿ“ Project Structure

This CLI is designed to be used inside a pew-managed virtualenv containing an Odoo project, structured as follows:

<project_root>/
โ”‚
โ”œโ”€โ”€ odoo/                             # Odoo core (source code)
โ”‚
โ”œโ”€โ”€ addons/
โ”‚   โ”œโ”€โ”€ custom_3rd_party_addons_1/    # 3rd party modules (OCA, ...)
โ”‚   โ”‚   โ”œโ”€โ”€ module_a/
โ”‚   โ”‚   โ”œโ”€โ”€ module_b/
โ”‚   โ”œโ”€โ”€ custom_3rd_party_addons_2/
โ”‚   โ”‚   โ”œโ”€โ”€ module_c/
โ”‚   โ”‚   โ”œโ”€โ”€ module_d/
โ”‚   ...
โ”‚
โ”œโ”€โ”€ project/                          # Customized modules for project
โ”‚   โ”œโ”€โ”€ project_module_1/
โ”‚   โ”œโ”€โ”€ project_module_2/
โ”‚   โ”œโ”€โ”€ project_module_3/
โ”‚
โ”œโ”€โ”€ config/
    โ”œโ”€โ”€ local.conf (or dev.conf)

Notes:

  • You don't need to specify the addons_path in the .conf file; the script will automatically calculate and prepare it for you based on the folder structure above.

๐Ÿ”„ odoo.sh Project Support

odooquickrun automatically detects whether your project uses the standard layout or an odoo.sh setup.

Detection Logic

  • If config.sh exists in the project root โ†’ odoo.sh mode
  • Otherwise โ†’ regular mode (standard layout)

odoo.sh Project Structure

<project_root>/
โ”œโ”€โ”€ config.sh                  # Project configuration (REQUIRED for detection)
โ”œโ”€โ”€ odoo.sh                    # Original launcher (optional, not used by odooquickrun)
โ”œโ”€โ”€ Makefile                   # Optional
โ””โ”€โ”€ <project_dirs>/            # Custom modules (referenced by PROJECT_DIRS)
    โ”œโ”€โ”€ module_a/
    โ””โ”€โ”€ module_b/

config.sh Variables

Variable Description Default
VERSION Odoo version (e.g., 17.0) Required
PROJECT Project name Directory name
PROJECT_DIRS Path(s) to custom addons โ€”
VENV Virtualenv name venv-odoo{VERSION}
DB Database name v{VERSION}{e/c}_{PROJECT}
IP Listen address 127.0.0.1
HTTP_PORT Listen port 8069
ODOO_ROOT_DIR Root dir for Odoo source ~/code/odoo
EXTRA_ADDONS_PATH Additional addons paths โ€”
EXTRA_PARAMS Extra odoo-bin parameters โ€”
ENTERPRISE Enable enterprise (1/0) 1

๐Ÿ›  Requirements

  • Python 3.7+
  • pew for managing virtual environments
  • odoo-bin available in your Odoo project path
  • PostgreSQL client tools (psql) installed and added to PATH

๐Ÿ‘ค Author

Phรบc Trแบงn Thanh (Felix)

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

odooquickrun-1.0.5.tar.gz (17.2 kB view details)

Uploaded Source

Built Distribution

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

odooquickrun-1.0.5-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file odooquickrun-1.0.5.tar.gz.

File metadata

  • Download URL: odooquickrun-1.0.5.tar.gz
  • Upload date:
  • Size: 17.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for odooquickrun-1.0.5.tar.gz
Algorithm Hash digest
SHA256 4269e1f06486dc46c0d66ac510c34cd4f4e2bb0eb0a1d8f199e58866ad929ad3
MD5 f5cf85e1cee809eb1dfc558855e55cf2
BLAKE2b-256 d7c06ed0969c2d7a6029563fa6a171a6726cef56ddc91a693a337a0ccf5f5bf7

See more details on using hashes here.

File details

Details for the file odooquickrun-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: odooquickrun-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 18.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for odooquickrun-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f08041af7fa764db567858fd778253f50d7182c442add04c8075ff92cef2f454
MD5 b64c1375c9c301bd32bd2a36c70b104f
BLAKE2b-256 e53bba9e50a656b9f59ac549726ffad833c72895eac0320edfafcdb6a5f801e5

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