[IMP] settings: simplify the developer mode page

task-3849915

closes odoo/documentation#9121

Signed-off-by: Xavier Platteau (xpl) <xpl@odoo.com>
This commit is contained in:
XPL 2024-05-02 16:43:58 +02:00
parent 22df52548b
commit df888df654
10 changed files with 49 additions and 83 deletions

View File

@ -1,100 +1,66 @@
.. _developer-mode:
===========================
Developer Mode (debug mode)
Developer mode (debug mode)
===========================
The developer mode (or debug mode) unlocks access to extra and advanced tools in Odoo. There are
several ways to activate the developer mode: through the
:ref:`settings <general/developer_mode/settings>`, the
:ref:`browser extension <general/developer_mode/browser-extension>`, through
the :ref:`command palette <general/developer_mode/command-palette>` or the
:ref:`URL <general/developer_mode/url>`.
The developer mode, also known as debug mode, unlocks access to advanced :ref:`tools and settings
<developer-mode/tools>` in Odoo.
.. _general/developer_mode/settings:
Activate through the Settings
=============================
The debug mode can be activated in the Odoo database settings. Go to :menuselection:`Settings -->
General Settings --> Developer Tools` and click on :guilabel:`Activate the developer mode`. At
least one application needs to be installed for the :guilabel:`Developer Tools` section to appear
in the :guilabel:`Settings` module.
.. image:: developer_mode/settings.png
:align: center
:alt: Overview of the debug options under settings in Odoo.
.. warning::
Proceed with caution, as some developer tools and technical settings are considered advanced and
may have associated risks. Only use them if you understand the implications and are confident in
your actions.
.. note::
:guilabel:`Activate the developer mode (with assets)` is used by developers; :guilabel:`Activate
the developer mode (with tests assets)` is used by developers and testers.
The developer mode is also available with :ref:`assets <frontend/framework/assets_debug_mode>`,
which are used to debug JavaScript code, and with :ref:`tests assets
<frontend/framework/tests_debug_mode>`, which are used to run test tours.
Activation
==========
To activate it, open the :guilabel:`Settings` app, scroll down to the :guilabel:`Developer Tools`
section, and click :guilabel:`Activate the developer mode`.
Once activated, the :guilabel:`Deactivate the developer mode` option becomes available.
.. _general/developer_mode/browser-extension:
.. image:: developer_mode/settings.png
:alt: Activating the developer mode in the Settings app
Activate through the browser extension
======================================
To activate the developer mode **from anywhere in the database**, add `?debug=1` to the URL after
`/web` (e.g., `https://example.odoo.com/web?debug=1#action=menu&cids=1`). To deactivate it, use
`?debug=0` instead.
Within a web browser, navigate to the browser settings and extensions and search for the `Odoo
Debug` extension. Once the extension is installed, a new icon will be shown on the browser's
toolbar.
For the *Odoo Debug* extension, a single click enables a normal version of the mode, while a
double click enables it with assets. To deactivate it, use a single click.
.. image:: developer_mode/developer-mode-monkey.png
:align: center
:alt: View of Odoo's debug icon in a Google Chrome toolbar.
.. _general/developer_mode/command-palette:
Activate through the command palette
====================================
In Odoo, the command palette tool has a command to activate the debug mode. First, open the command
palette tool with the keyboard shortcut `ctrl+k` and then type `debug`. A command will show up to
activate the debug mode.
.. image:: developer_mode/command-palette.png
:align: center
:alt: Command palette with debug command.
.. _general/developer_mode/url:
Activate through the URL
========================
The debug mode can also be activated by adding an extra query string to the database's URL. In the
URL, add `?debug=1` or `?debug=true` after `/web`. To deactivate the debug mode, change the
value to `?debug=0` instead.
.. image:: developer_mode/url.png
:align: center
:alt: Overview of a URL with the debug mode command added.
Use `?debug=assets` to activate the developer mode with assets and `?debug=tests` to activate it
with tests assets.
.. tip::
Additional modes are available for developers: `?debug=assets` enables the
:ref:`assets mode <frontend/framework/assets_debug_mode>`, and `?debug=tests` enables
the :ref:`tests mode <frontend/framework/tests_debug_mode>`.
Open the **command palette** by pressing `Ctrl + K` or `Cmd ⌘ + K`, then type `debug` to
activate the developer mode with assets or deactivate it.
.. _developer-mode/mode-tools:
.. admonition:: Browser extension
Locate the developer mode tools
===============================
The `Odoo Debug <https://github.com/Droggol/OdooDebug>`_ browser extension adds an icon to toggle
developer mode on or off from the browser's toolbar. It is available on the `Chrome Web Store
<https://chromewebstore.google.com/detail/odoo-debug/hmdmhilocobgohohpdpolmibjklfgkbi>`_ and
`Firefox Add-ons <https://addons.mozilla.org/firefox/addon/odoo-debug/>`_.
Once developer mode is activated, the developer mode tools can be accessed from the :guilabel:`Open
Developer Tools` button, the bug icon located in the header of the Odoo database.
.. _developer-mode/tools:
.. image:: developer_mode/button-location.png
:align: center
:alt: Overview of a console page and the debug icon being shown in Odoo.
Developer tools and technical menu
==================================
This menu contains additional tools that are useful to understand or edit technical data, such as
the views or actions of a page. On a page that has filters, actions, and view options, the
developer mode tools contain some useful menu items such as:
Once the developer mode is activated, the developer tools can be accessed by clicking the
:icon:`fa-bug` :guilabel:`(bug)` icon. The menu contains tools useful for understanding or editing
technical data, such as a view's field, filters, or actions. The options available depend on where
the menu is accessed from.
- :guilabel:`Edit Action`
- :guilabel:`Manage Filters`
- Edit the current view (e.g. Kanban, List, Graph, etc.)
- See the :guilabel:`Fields View Get`
.. image:: developer_mode/tools.png
:alt: Accessing the developer tools
Database administrators can access the technical menu from the :guilabel:`Settings` app. It contains
advanced database settings, such as ones related to the database structure, security, actions, etc.
.. image:: developer_mode/technical.png
:alt: Accessing the technical menu

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

View File

@ -40,7 +40,7 @@ including tests.
#. Before starting a profiling session, the profiler must be enabled globally on the database.
This can be done in two ways:
- Open the :ref:`developer mode tools <developer-mode/mode-tools>`, then toggle the
- Open the :ref:`developer mode tools <developer-mode/tools>`, then toggle the
:guilabel:`Enable profiling` button. A wizard suggests a set of expiry times for the
profiling. Click on :guilabel:`ENABLE PROFILING` to enable the profiler globally.
@ -51,7 +51,7 @@ including tests.
#. After the profiler is enabled on the database, users can enable it on their session. To do
so, toggle the :guilabel:`Enable profiling` button in the :ref:`developer mode tools
<developer-mode/mode-tools>` again. By default, the recommended options :guilabel:`Record
<developer-mode/tools>` again. By default, the recommended options :guilabel:`Record
sql` and :guilabel:`Record traces` are enabled. To learn more about the different options,
head over to :ref:`performance/profiling/collectors`.
@ -127,7 +127,7 @@ Analyse the results
To browse the profiling results, make sure that the :ref:`profiler is enabled globally on the
database <performance/profiling/enable>`, then open the :ref:`developer mode tools
<developer-mode/mode-tools>` and click on the button in the top-right corner of the profiling
<developer-mode/tools>` and click on the button in the top-right corner of the profiling
section. A list view of the `ir.profile` records grouped by profiling session opens.
.. image:: performance/profiling_web.png
@ -172,7 +172,7 @@ Whereas the profiler is about the *when* of profiling, the collectors take care
Each collector specializes in collecting profiling data in its own format and manner. They can be
individually enabled from the user interface through their dedicated toggle button in the
:ref:`developer mode tools <developer-mode/mode-tools>`, or from Python code through their key or
:ref:`developer mode tools <developer-mode/tools>`, or from Python code through their key or
class.
There are currently four collectors available in Odoo: