Activating the Odoo developer tools
When using Odoo as a developer, you need to know how to activate Developer Mode in the web interface to access the advanced settings menu and developer information.
How to do it...
To activate Developer Mode in the web interface, do as follows:
- Connect to your instance and authenticate as
admin
- Go to the
Settings
menu - Locate the
Share the love
card, which should be on the right of the screen: - Click on the
Activate the developer mode
link
- Wait for the UI to reload
Note
It is also possible to activate the developer mode by editing the URL; before the #
sign, insert ?debug
. For instance, if you are starting from http://localhost:8069/web#menu_id=102&action=94
, then you need to change this tohttp://localhost:8069/web?debug=#menu_id=102&action=94
.To exit the developer mode, you can do either of these:
- Edit the URL and remove that string
- Close your browser tab and open a new one
- Use the
Deactivate the developer mode link displayed in the
Share the love card
when the Developer mode is active
How it works...
When in developer mode, two things happen:
- You get tooltips when hovering over a field in a form view or over a column in list view, providing technical information about the field (internal name, type, and so on)
- A drop-down menu with a
Bug
icon is displayed next to the user's menu in the top-right corner, giving access to technical information about the model being displayed, the various related view definitions, the workflow, custom filter management, and so on
There is a variant of the developer mode—the Developer mode (with assets)
. This mode behaves as the normal developer mode, but additionally, the JavaScript and CSS code sent to the browser is not minified, which means that the web development tools of your browser are easy to use for debugging the JavaScript code (more on this in Chapter 15, Web Client Development).
Note
Caution! Test your addons both with and without developer mode, as the unminified versions of the JavaScript libraries can hide bugs that only bite you in the minified version.