Beyond -u: Hidden Odoo CLI Options That Make Development Easier

Five odoo-bin flags for faster debugging and testing, and one --dev=all gotcha

Every Odoo developer knows the command that keeps the day moving:

./odoo-bin -d database -u module

It upgrades your module and reloads its data. But odoo-bin has a set of less-visible options that save real time when you are chasing an access error, running one test, or checking how your module behaves in production-like setups. Here are five we use regularly at Optura, and one gotcha that catches even experienced developers.

1. --dev=access: see why you got a 403

An AccessError in a controller or RPC call usually reaches you as a bare 403 page or a short message. That tells you something was denied, not which rule, model or method denied it.

./odoo-bin -d database --dev=access

With this mode on, Odoo logs the full traceback behind HTTP access errors. You can see the exact check_access call, record rule or ACL that failed, and fix the security file instead of guessing.

Use it when: a portal user, website visitor or restricted employee hits an access error you can't reproduce as admin.

2. --test-file: run one test file, not the whole suite

Running a module's full test suite to check one fix is slow. Point Odoo at a single file instead:

./odoo-bin -d database --test-file addons/my_module/tests/test_feature.py

Odoo turns on testing automatically and stops once the file has run, so you don't need --test-enable or --stop-after-init. The module must already be installed in the database you pass.

Use it when: you are iterating on one feature and want a feedback loop of seconds, not minutes.

3. --log-handler: DEBUG for one module only

Setting --log-level=debug turns on DEBUG everywhere: ORM, HTTP, cron, every installed addon. Your own messages get buried. Target a single logger instead:

./odoo-bin -d database --log-handler=odoo.addons.my_module:DEBUG

Only my_module logs at DEBUG; everything else keeps its normal level. You can repeat the flag to add more loggers, for example --log-handler=odoo.sql_db:DEBUG when you also want to see the SQL.

Use it when: you need detailed output from your code without scrolling through thousands of unrelated lines.

4. --skip-auto-install: catch hidden dependencies

Odoo has bridge modules marked auto_install. They install themselves when all their dependencies are present, such as sale_stock when both sale and stock are installed. That convenience can hide a bug: your module may use a field or method from a bridge module without listing it in depends.

./odoo-bin -d fresh_db -i my_module --skip-auto-install

With auto-install skipped, only what your manifest declares gets installed. If something breaks, you've found a missing dependency before a client did.

Use it when: you are preparing a module for release, the App Store, or a client database with a different set of apps.

5. --dev=replica: test read-replica routing on your laptop

Large deployments often send read-only work to a PostgreSQL read replica. Code that writes inside a route meant to be read-only will fail there, but setting up a real replica just to test that is heavy.

./odoo-bin -d database --dev=replica

Odoo creates a second connection pool that points at the same database, but its transactions are read-only. Any route that is routed to the "replica" and tries to write will fail immediately, just as it would in production.

Use it when: you are building reports, dashboards or public pages that should run safely on a replica.

The gotcha: --dev=all is not everything

The name suggests every dev mode. It isn't. --dev=all turns on access, qweb, reload and xml, but leaves out replica and werkzeug.

If you want those as well, list them explicitly:

./odoo-bin -d database --dev=all,replica

Modes are comma-separated, so you can also pick only what you need, for example --dev=xml,reload for view work.

Quick reference

OptionWhat it doesReach for it when
--dev=accessLogs the traceback behind HTTP access errorsA user gets a 403 you can't explain
--test-file <path>Runs one test file, then stopsIterating on a single feature
--log-handler=<logger>:DEBUGDEBUG for one logger onlyYou need detail without noise
--skip-auto-installSkips auto-install bridge modulesChecking depends before release
--dev=replicaRead-only second pool on the same DBTesting replica-safe routes
--dev=allaccess, qweb, reload, xml onlyEveryday dev; add replica yourself

Make them part of your routine

None of these flags is new, but few teams use them day to day. Adding two or three to your standard run command, or to a VS Code launch config, removes a lot of guesswork from debugging and testing.

Want your team to work this way? Optura Technologies helps companies build, test and ship reliable Odoo modules, and our Code Wave program trains developers on exactly these practices. Get in touch to talk about your project.

Share this post
Tags
Archive
Odoo 20: New Features and Major Changes
AI workflows, offline mode, Sales, Inventory, Manufacturing, Accounting, Website and POS