Debugging In Odoo 14

DEBUGGING IN ODOO 14

In software development and programming, debugging is the process of distinguishing and fixing out bugs. Debugging methodologies include problem simplification, unit testing, clustering of bugs, backtracking, control flow analysis, coordinated testing, and profiling Debugging is important for the efficient running of software. We can utilize various debugging tools for Odoo development

Step 1: First we need to activate developer mode

Developer mode is a tool that is used by a developer or administrator to get technical information about data. By activating developer mode Odoo will give you much more on-screen data as you explore through the interface, It grants access to technical features of odoo. Let us see how to enable developer mode in Odoo,

Go to Odoo interface > Settings > scroll down

Now we can activate developer mode, and upon activating developer mode when you place the mouse pointer over the field you will be depicted with the information of the respective field 

Odoo Debugging Using Python PDB package

The package pdb gives an interactive source code debugging tool to enhance  Python programs. It enables setting conditional breakpoints and single stepping at the source line level; it is specified as the class pdb which can be easily recognized by reading the source. 

From our source code we can define two lines of code import pdb and pdb.set_trace() inside action or a statement. Once the execution of code reaches here the execution will stop at this point. Let me give an example

I have declared the pdb package and set_trace() inside create. Inside this create, the execution will stop once the statements reach pdb statements and the UI it’s still loading.

 

Leave a Reply

Your email address will not be published.