A sample debugging session

Let's see what a simple debugging session looks like. We can start by adding a debugger breakpoint in the first line of the do_populate_tasks wizard method:

def do_populate_tasks(self):
    import pdb; pdb.set_trace()
    self.ensure_one()
    # ...

Now, restart the server, open a To-do Tasks Wizard form, and click on the Get All button. This will trigger the do_populate_tasks wizard method on the server, and the web client will stay in a Loading… state, waiting for the server's response. Looking at the Terminal window where the server is running, you will see something similar to this:

> /home/daniel/odoo-dev/custom-addons/todo_stage/models/todo_wizard_model.py(54)do_populate_tasks()
-> self.ensure_one()
(Pdb)

This is the ...

Get Odoo 11 Development Essentials - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.