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

Define onchange methods


When writing Odoo models, it is often the case that some fields are interrelated. We have seen how to specify constraints between fields in the Add constraint validations to a Model recipe in Chapter 4, Application Models. This recipe illustrates a slightly different concept—onchange methods are called when a field is modified in the user interface to update the values of other fields of the record in the web client, usually in a form view.

We will illustrate this by providing a wizard similar to the one defined in the preceding recipe, Write a wizard to guide the user, but which can be used to record loan returns. When the member is set on the wizard, the list of books is updated to the books currently borrowed by the member. While we are demonstrating onchange methods on a TransientModel, these features are also available on normal Models.

Getting ready

If you want to follow the recipe, make sure you have the my_module addon from Chapter 3, Creating Odoo Modules, with...