[IMP] settings: simplify the developer mode page

task-3849915

closes odoo/documentation#9238

X-original-commit: 67f02edd7b
Signed-off-by: Xavier Platteau (xpl) <xpl@odoo.com>
This commit is contained in:
XPL 2024-05-02 14:43:58 +00:00
parent 364d997cae
commit f7769365bc
11 changed files with 52 additions and 87 deletions

View File

@ -1,102 +1,67 @@
.. _developer-mode: .. _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 The developer mode, also known as debug mode, unlocks access to advanced :ref:`tools and settings
several ways to activate the developer mode: through the <developer-mode/tools>` in Odoo.
: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>`.
.. _general/developer_mode/settings: .. warning::
Proceed with caution, as some developer tools and technical settings are considered advanced and
Activate through the Settings may have associated risks. Only use them if you understand the implications and are confident in
============================= your actions.
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.
.. note:: .. note::
:guilabel:`Activate the developer mode (with assets)` is used by developers; :guilabel:`Activate The developer mode is also available with :ref:`assets <frontend/framework/assets_debug_mode>`,
the developer mode (with tests assets)` is used by developers and testers. which are used to debug JavaScript code, and with :ref:`tests assets
<frontend/framework/tests_debug_mode>`, which are used to run test tours.
.. _developer-mode/activation:
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. 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` at the end of the
====================================== URL (e.g., `https://example.odoo.com/odoo?debug=1`). To deactivate it, use `?debug=0` instead.
Within a web browser, navigate to the browser settings and extensions and search for the `Odoo Use `?debug=assets` to activate the developer mode with assets and `?debug=tests` to activate it
Debug` extension. Once the extension is installed, a new icon will be shown on the browser's with tests assets.
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:
.. _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.
.. tip:: .. tip::
Additional modes are available for developers: `?debug=assets` enables the Open the **command palette** by pressing `Ctrl + K` or `Cmd ⌘ + K`, then type `debug` to
:ref:`assets mode <frontend/framework/assets_debug_mode>`, and `?debug=tests` enables activate the developer mode with assets or deactivate it.
the :ref:`tests mode <frontend/framework/tests_debug_mode>`.
.. _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-mode/tools:
Developer Tools` button, the bug icon located in the header of the Odoo database.
.. image:: developer_mode/button-location.png Developer tools and technical menu
:align: center ==================================
:alt: Overview of a console page and the debug icon being shown in Odoo.
This menu contains additional tools that are useful to understand or edit technical data, such as Once the developer mode is activated, the developer tools can be accessed by clicking the
the views or actions of a page. On a page that has filters, actions, and view options, the :icon:`fa-bug` :guilabel:`(bug)` icon. The menu contains tools useful for understanding or editing
developer mode tools contain some useful menu items such as: 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` .. image:: developer_mode/tools.png
- :guilabel:`Manage Filters` :alt: Accessing the developer tools
- Edit the current view (e.g. Kanban, List, Graph, etc.)
- See the :guilabel:`Fields View Get` 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. #. Before starting a profiling session, the profiler must be enabled globally on the database.
This can be done in two ways: 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 :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. 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 #. 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 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, sql` and :guilabel:`Record traces` are enabled. To learn more about the different options,
head over to :ref:`performance/profiling/collectors`. 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 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 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. section. A list view of the `ir.profile` records grouped by profiling session opens.
.. image:: performance/profiling_web.png .. 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 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 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. class.
There are currently four collectors available in Odoo: There are currently four collectors available in Odoo:

View File

@ -91,8 +91,8 @@ As a first exercise, let us modify the `Playground` component located in
.. tip:: .. tip::
The Odoo JavaScript files downloaded by the browser are minified. For debugging purpose, it's The Odoo JavaScript files downloaded by the browser are minified. For debugging purpose, it's
easier when the files are not minified. Switch to easier when the files are not minified. Switch to :ref:`debug mode with assets
:ref:`debug mode with assets <developer-mode/url>` so that the files are not minified. <developer-mode/activation>` so that the files are not minified.
This exercise showcases an important feature of Owl: the `reactivity system <{OWL_PATH}/doc/reference/reactivity.md>`_. This exercise showcases an important feature of Owl: the `reactivity system <{OWL_PATH}/doc/reference/reactivity.md>`_.
The `useState` function wraps a value in a proxy so Owl can keep track of which component The `useState` function wraps a value in a proxy so Owl can keep track of which component