December 2018
Beginner to intermediate
404 pages
10h 14m
English
In some cases, the method is prepared to work with a single record (a singleton). Here, we could use the @api.one decorator that's still available, but announced as deprecated since Odoo 9. It wraps the decorated method, doing the for loop iteration, calling the decorated method with it one record at a time, and then returning a list with the results. So, inside an @api.one decorated method, self is guaranteed to be a singleton.
Read now
Unlock full access