O'Reilly logo

Odoo Development Cookbook by Daniel Reis, Alexandre Fayolle, Holger Brunn

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Call onchange methods on the server side

The Create new records and Update values of a recordset record recipes in Chapter 5, Basic Server Side Development, mentioned that these operations did not call onchange methods automatically. Yet in a number of cases it is important that these operations are called because they update important fields in the created or updated record. Of course, you can do the required computation yourself, but this is not always possible as the onchange method can be added or modified by a third-party addon module installed on the instance that you don't know about.

This recipe explains how to call the onchange methods on a record by manually playing the onchange method before creating a record.

Getting ready

We will reuse ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required