There's more…

If the model defined some default values for some fields, nothing special needs to be done; create() will take care of computing the default values for the fields not present in the supplied dictionary.

On the other hand, onchange methods are not called by create(), because they are called by the web client during the initial edition of the record. Some of these methods compute default values for fields related to a given field. When creating records by hand, you have to do the work yourself, either by providing explicit values or by calling the onchange methods. The Calling onchange methods on the server side recipe in Chapter 9, Advanced Server-Side Development Techniques, explains how to do this.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.253.62