Book Image

Odoo Development Cookbook

By : Holger Brunn, Alexandre Fayolle, Daniel Reis
Book Image

Odoo Development Cookbook

By: Holger Brunn, Alexandre Fayolle, Daniel Reis

Overview of this book

Odoo is a full-featured open source ERP with a focus on extensibility. The flexibility and sustainability of open source is also a key selling point of Odoo. It is built on a powerful framework for rapid application development, both for back-end applications and front-end websites. The book starts by covering Odoo installation and administration, and provides a gentle introduction to application development. It then dives deep into several of the areas that an experienced developer will need to use. You’ll learn implement business logic, adapt the UI, and extend existing features.
Table of Contents (23 chapters)
Odoo Development Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

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

Getting ready

We will reuse the same code as in the previous recipe to produce server logs to help debug methods; this enables the product.product model to add a new method. We assume that you have an instance with the addon installed available. In the recipe, we expect that you have an Odoo configuration file for this instance called project.conf.

How to do it…

In order to call the export_stock_level() method from the Odoo shell, you need to perform the following...