Skip to content

Latest commit

Β 

History

History
132 lines (98 loc) Β· 3.19 KB

File metadata and controls

132 lines (98 loc) Β· 3.19 KB

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.

πŸ–₯️ 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]

πŸ“ 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.

πŸ›  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)