开发者模式(Debug)

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 settings, the browser extension, through the command palette or the URL.

通过“设置”激活

The debug mode can be activated in the Odoo database settings. Go to Settings ‣ General Settings ‣ Developer Tools and click on Activate the developer mode. At least one application needs to be installed for the Developer Tools section to appear in the Settings module.

Overview of the debug options under settings in Odoo.

注解

Activate the developer mode (with assets) is used by developers; Activate the developer mode (with tests assets) is used by developers and testers.

Once activated, the Deactivate the developer mode option becomes available.

Activate through the browser extension

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.

对于 Odoo Debug 扩展,单击可启用模式的正常版本,而双击将启用资产。若要停用,请单击。

View of Odoo's debug icon in a Google Chrome toolbar.

通过命令面板激活

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.

Command palette with debug command.

通过网址激活

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.

Overview of a URL with the debug mode command added.

小技巧

开发人员可以使用其他模式:?debug=assets`来启用 :ref:`assets模式<frontend/framework/assets_debug_mode>,以及 ?debug=tests 。来启用 tests 模式

Locate the developer mode tools

Once developer mode is activated, the developer mode tools can be accessed from the Open Developer Tools button, the bug icon located in the header of the Odoo database.

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 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:

  • Edit Action

  • Manage Filters

  • Edit the current view (e.g. Kanban, List, Graph, etc.)

  • See the Fields View Get