Skip to content

Full-featured interactive IPython console for Odoo development, replicating PyCharm Console functionality with enhanced Odoo-specific features.

License

Notifications You must be signed in to change notification settings

AlexTkDev/ipython-console-to-VScode

Repository files navigation

Odoo IPython Console - PyCharm Edition 🚀

Full-featured interactive IPython console for Odoo development, replicating PyCharm Console functionality with enhanced Odoo-specific features and a beautiful Rich user interface.

🎯 Key Features

🎨 Rich UI & UX

  • Beautiful Output - Powered by Rich for colorful tables, panels, and inspection.
  • PyCharm-like REPL - Full interactive shell with automatic result display.
  • Smart Inspection - Deep object introspection with syntax highlighting.

🛠️ Core Functionality

  • Multiline Editing - Smart auto-indent for code blocks.
  • Persistent History - Command history saved between sessions.
  • Enhanced Autocompletion - Jedi-powered with Odoo model awareness.

⚡ Odoo-Specific Tools

  • Preloaded Environment - env ready for immediate ORM operations.
  • Smart Model Completion - Tab-complete model names, fields, domains.
  • Domain Builder - Autocomplete operators and field values.
  • Transaction Control - Visual feedback for commit/rollback.

📦 Installation

This project is now a proper Python package.

  1. Clone the repository:

    git clone https://github.com/AlexTkDev/ipython-console-to-VScode.git
    cd ipython-console-to-VScode
  2. Install in editable mode:

    pip install -e .

    This will automatically install all dependencies including odoo, ipython, and rich.

🚀 Usage

Standard Launch

Once installed, you can use the odoo-console command:

odoo-console -d your_database_name

Legacy Launch

You can still use the wrapper script if you prefer:

python3 odoo_IPython_Console.py -d your_database_name

Options

# Custom config file
odoo-console -d mydb -c /path/to/odoo.conf

# Disable autocompletion
odoo-console -d mydb --no-autocomplete

# Safe mode (restrict write operations)
odoo-console -d mydb --safe-mode

📚 Available Commands

Command Description Example
env Odoo ORM environment env['res.partner']
show(record) Pretty-print records with Rich tables show(partners)
lsmodels() List all models with descriptions lsmodels()
lsfields(model) List model fields with types lsfields('sale.order')
lsallfields(model) Fields with sample values lsallfields('res.users')
lsvars() List all workspace variables lsvars()
inspect_obj(obj) Deep object inspection (Rich) inspect_obj(env)
profile_query(func) Profile function performance profile_query(search_func)
q(model, domain) Quick search with domain q('res.partner', [('id','=',1)])
commit() Commit transaction commit()
rollback() Rollback transaction rollback()

💡 Examples

Visual Record Inspection

# Search and display records with beautiful formatting
partners = env['res.partner'].search([], limit=5)
show(partners)

Deep Inspection

# Inspect any object, model, or function
inspect_obj(env['res.partner'])

🔧 Configuration

  • History: Saved to .odoo_console_history in the current working directory.
  • Rich Theme: Uses standard Rich themes for best readability.

🤝 Contributing

  1. Install dev dependencies: pip install -e ".[test]"
  2. Run tests: pytest

📄 License

LGPL-3.0

About

Full-featured interactive IPython console for Odoo development, replicating PyCharm Console functionality with enhanced Odoo-specific features.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages