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 Adding constraint validations to a Model recipe in Chapter 5, 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 Write a wizard to guide the user recipe, 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.
...