Dynamic views

View elements also support a few dynamic attributes that allow views to dynamically change their appearance or behavior depending on field values . We may have on change events, able change values on other fields while editing data on a form, or have fields to be mandatory or visible only when certain conditions are met.

On change events

The on change mechanism allows us to change values in other form fields when a particular field is changed. For example, the on change on a Product field can set the Price field with a default value whenever the product is changed.

In older versions the on change events were defined at the view level, but since version 8.0 they are defined directly on the Model layer, without the need for any specific ...

Get Odoo 10 Development Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.