Activating Odoo developer tools — Installing the Odoo Development Environment
When using Odoo as a developer, you need to know how to activate developer mode in the web interface so that you can access the technical settings menu and developer information. Enabling debug mode will expose several advance configuration options and fields. These options and fields are hidden in Odoo for better usability because they are not used on a daily basis.
How to do it…
To activate developer mode in the web interface, perform the following steps:
- Connect to your instance and authenticate as admin.
- Go to the Settings menu.
- Scroll to the bottom and locate the Developer Tools section:
4. Click on the Activate the developer mode link
5. Wait for the UI to reload.
Alternative way
It is also possible to activate the developer mode by editing the URL. Before the #
sign, insert ?debug=1
.
For example, if your current URL is http://localhost:8069/web#menu_id&action=94
, and you want to enable developer mode, then you need to change that URL to http://localhost:8069/web?debug=1#menu_id=102&action=94
.
Furthermore, if you want debug mode with assets, then change the URL to http://localhost:8069/web?debug=assets#menu_id=102&action=94
.
To exit developer mode, you can perform any one of the following operations:
- Edit the URL and write
?debug=0
in the query string. - Use Deactivate the developer mode from the same place in the Settings menu.
- Click on the bug icon in the top menu and click on the Leave Developer Tools option.
Lots of developers are using browser extensions to toggle debug mode. By using this, you can toggle debug mode quickly without accessing the settings menu. These extensions are available for Firefox and Chrome. Take a look at the following screenshot. It will help you to identify the plugin in the Chrome store:
Note :
The behavior of debug mode has changed since Odoo v13. Since v13, the status of the debug mode is stored in session, implying that even if you have removed?debug
from the URL, debug mode will still be active.
How it works…
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 developer mode — Developer mode (with assets). This mode behaves like the normal developer mode, but additionally, the JavaScript and CSS code that’s 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 (for-more-chap15).
Caution!
Test your add-ons 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.
Other :
Odoo 14 Development Cookbook Fourth Edition : page 63 — 65