Using the Odoo shell to interactively call methods
The Odoo web interface is meant for end users, although the developer mode unlocks a number of powerful features. However, testing and debugging through the web interface is not the easiest way to do things, as you need to manually prepare the data, navigate in the menus to perform actions, and so on. The Odoo shell is a command-line interface, which you can use to issue calls. This recipe shows how to start the Odoo shell and perform actions such as calling a method inside the shell.
We will reuse the same code as in the previous recipe to produce server logs to help debug methods. This allows the
product.product model to add a new method. We will assume that you have an instance with the add-on installed and available. In this recipe, we expect that you have an Odoo configuration file for this instance called
How to do it...
In order to call the
export_stock_level() method from the Odoo shell...