There's more...

You may encounter the @api.one decorator while reading source code. This decorator was deprecated because its behavior can be confusing at first glance. Also, if you are aware of @api.multi, you might think that this decorator allows the method to be called only on recordsets of a size of 1, but it does not. When it comes to the recordset length, @api.one is similar to @api.multi, but it does a for loop on the recordset outside the method and aggregates the returned value of each iteration of the loop in a list, which is returned to the caller.

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

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