How it works...

In step 1, we hard code a break point in the source code of the method by calling the set_trace() method of the pdb module from the Python standard library. When this method is executed, the normal flow of the program stops, and you get a (Pdb) prompt in which you can enter pdb commands.

Step 2 calls the stock_level_export() method using the shell mode. It is also possible to restart the server normally and to use the web interface to generate a call to the method you need to trace by clicking on the appropriate elements of the user interface.

When you need to manually step through some code using the Python debugger, here are a few tips that will make your life easier:

  • Reduce the logging level to avoid having too many log ...

Get Odoo 11 Development Cookbook - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.