There's more...

In Chapter 6, Basic Server-Side Development, we saw how to redefine the write() methods of a model to perform actions on record updates. Automated actions on record updates provide another way to achieve this, with some benefits and drawbacks.

Among the benefits, it is easy to define an action triggered by the update of a stored computed field, which is tricky to do in pure code. It is also possible to define filters on records and have different rules for different records, or for records matching different conditions that can be expressed with search domains.

However, automated actions can have disadvantages when compared to Python business logic code inside modules. With poor planning, the flexibility provided can lead to complex interactions that are difficult to maintain and debug. Also, the before-and-after write filter operations bring some overhead, which can be an issue if you are performing sensitive actions.

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

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