Skip to content

Cooperation-org/odoo-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

odoo-cli

Manage Odoo CRM from the command line. No UI needed.

A single bash script that talks to Odoo via XML-RPC. Manage users, contacts, CRM pipeline, follow-ups, modules, and OAuth — all from your terminal.

Works with Odoo 16, 17, and 18.

Install

# Copy the script somewhere in your PATH
curl -o /usr/local/bin/odoo-cli https://raw.githubusercontent.com/Cooperation-org/odoo-cli/main/odoo-cli
chmod +x /usr/local/bin/odoo-cli

# Set your credentials
export ODOO_URL="http://localhost:8069"
export ODOO_DB="mydb"
export ODOO_API_KEY="your-api-key"

# Test it
odoo-cli status

Or create ~/.odoo-cli.conf:

ODOO_URL="http://localhost:8069"
ODOO_DB="mydb"
ODOO_API_KEY="your-api-key"

Requirements

  • Bash
  • Python 3 (uses only stdlib xmlrpc.client — no pip installs)
  • psycopg2 and passlib (only for user-password command)

Commands

Status

odoo-cli status                    # Check if Odoo is running
odoo-cli setup                     # Create custom fields for follow-up tracking

Users

odoo-cli user-list                 # List all active users
odoo-cli user-create "Jane" "jane@co.com" "s3cret"
odoo-cli user-password jane "newpass"
odoo-cli user-disable jane

Contacts

odoo-cli contact-list              # List all contacts
odoo-cli contact-list "acme"       # Search by name or email
odoo-cli contact-search "jane"     # Detailed search (name, email, phone)
odoo-cli contact-create "Jane Doe" "jane@example.com"
odoo-cli contact-export            # Export all contacts as JSON
odoo-cli contact-export "acme"     # Export matching contacts as JSON
odoo-cli contact-tag "Jane" ally   # Add a tag (creates tag if new)
odoo-cli contact-untag "Jane" ally # Remove a tag

CRM Follow-ups

Track when you last talked to someone and when to follow up. Requires CRM module and odoo-cli setup.

# Set a follow-up date — accepts YYYY-MM-DD, day names, month names, or +Nd
odoo-cli follow-up set "Jane" tuesday
odoo-cli follow-up set "Jane" april "wait for Q2 budget"
odoo-cli follow-up set "Jane" 2025-03-15 "send proposal"
odoo-cli follow-up set "Jane" +7d

# List all upcoming follow-ups, sorted by date
odoo-cli follow-up list

# Log when you last contacted someone (defaults to today)
odoo-cli contacted "Jane"
odoo-cli contacted "Jane" 2025-02-10

Modules

odoo-cli module-list               # List installed modules
odoo-cli module-list "sale"        # Search modules
odoo-cli module-install crm        # Install a module

OAuth

odoo-cli oauth-status              # Show configured providers
odoo-cli oauth-setup <client_id> <client_secret>  # Configure Google OAuth

Shell

odoo-cli shell                     # Interactive Python shell with Odoo API

Configuration

Variable Default Description
ODOO_URL http://localhost:8069 Odoo server URL
ODOO_DB odoo Database name
ODOO_API_KEY API key (preferred auth method)
ODOO_PASSWORD Admin password (fallback)
ODOO_PYTHON python3 Python 3 interpreter path
ODOO_CONF /etc/odoo/odoo.conf Odoo config file (for user-password)

Config can be set as environment variables or in a config file. The script checks these locations in order:

  1. ./.odoo-cli.conf (current directory)
  2. ~/.odoo-cli.conf (home directory)
  3. /etc/odoo-cli.conf (system-wide)

How it works

Uses Odoo's built-in XML-RPC API (/xmlrpc/2/common and /xmlrpc/2/object). No custom Odoo modules required. The setup command creates a custom field (x_last_contacted) on CRM leads for tracking contact dates.

The user-password command connects directly to PostgreSQL (requires psycopg2 and read access to the Odoo config file) because Odoo's XML-RPC API doesn't support password changes.

License

MIT

About

Manage Odoo CRM from the command line. No UI needed.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages