Odoo’s --dev Mode: Speed Up Development & Debugging

⚡ Odoo’s --dev Mode: Speed Up Development & Debugging Like a Pro

Imagine this: You’re knee-deep in Odoo development, tweaking code, testing modules, and—ugh—manually restarting the server every single time you make a change. Sounds exhausting, right? What if I told you there’s a hidden turbo button for Odoo developers? Enter --dev mode—a simple yet game-changing flag that supercharges your workflow.

Activate it (odoo-bin --dev=reload), and suddenly, your Odoo instance transforms. Code changes auto-reload, assets debug themselves, and your productivity skyrockets. No more frantic server restarts or wasted minutes. Intrigued? Let’s break down why --dev is every Odoo developer’s secret weapon.


🛠️ What Is Odoo’s --dev Mode?

Odoo’s --dev (development) mode is a powerful command-line flag designed to streamline debugging and development. Instead of manually restarting the server after every tweak, this mode enables:

  • Auto-reloading of Python code (no more Ctrl+C → restart cycles!).
  • Debugging tools for JavaScript and CSS (say goodbye to cryptic errors).
  • Faster testing with features like --dev=reload and --dev=all.

Think of it as swapping a bicycle for a sports car when building Odoo modules.


🚀 Key Features of --dev Mode (And Why You’ll Love Them)

1️⃣ Auto-Reload Python Code (--dev=reload)

The biggest headache in Odoo development? Restarting the server for every minor code change. With --dev=reload, Odoo automatically detects Python file changes and reloads them—no manual intervention needed.

How to use:

odoo-bin --dev=reload  

Best for: Rapid module development, testing small logic tweaks.

2️⃣ Debug Frontend Assets (--dev=assets)

Working on JavaScript, XML, or CSS? This flag forces Odoo to serve unminified assets, making debugging way easier.

How to use:

odoo-bin --dev=assets  

Best for: Frontend customization, fixing UI bugs.

3️⃣ Full Power Mode (--dev=all)

Why choose when you can have everything? --dev=all combines:

  • reload (auto-refresh Python)
  • assets (debug JS/CSS)
  • xml (debug QWeb templates)

How to use:

odoo-bin --dev=all  

Best for: Full-stack Odoo development.

4️⃣ Enable Debugger Tools (--debug)

While not part of --dev, combining --debug with --dev gives you:

  • Python Debugging (pdb): Pause execution and inspect variables.
  • Browser Developer Tools: Enhanced logging for frontend issues.

Pro tip:

odoo-bin --dev=all --debug  

🔥 How --dev Mode Saves You Hours

Without --dev With --dev
Manually restart server 10x/day Code auto-reloads instantly
Debug minified JS/CSS Work with readable source files
Slow, frustrating testing Lightning-fast iterations

💡 Real-world impact: A developer reported cutting debugging time by 60% after switching to --dev=all.


🛑 Common Pitfalls (And How to Avoid Them)

While --dev is magical, it’s not perfect:

Don’t use it in production! (Security & performance risks.)
Auto-reload isn’t instant (Some changes still need a full restart.)
Memory leaks (Long-running --dev sessions may slow down.)

Fix: Use --dev only in local/dev environments and restart occasionally.


🎯 How to Activate --dev Mode

Step 1: Navigate to your Odoo installation folder.

Step 2: Run with your preferred --dev flag:

./odoo-bin --dev=all  # For maximum power  

or

./odoo-bin --dev=reload,assets  # Mix and match  

💬 “Which --dev Feature Do You Love Most?”

I’m a huge fan of --dev=reload—nothing beats coding without constant restarts. What’s your favorite?

Try it today and feel the difference! 🚀


📌 Final Tip: Combine --dev with --log-level=debug for ultra-detailed logs.

Now it’s your turn:
🔥 Have you tried --dev mode? Which flag saved you the most time?
🔥 Any cool tricks I missed? Share below!

Happy coding! 👨‍💻👩‍💻

Debug Odoo Like a Pro with VS Code