There's more...

When using mapped(), keep in mind that it operates in the memory inside the Odoo server by repeatedly traversing relations and therefore making SQL queries, which may not be efficient; however, the code is terse and expressive. If you are trying to optimize a method on the critical path of the performance of your instance, you may want to rewrite the call to mapped() and express it as a search() with the appropriate domain, or even move to SQL (at the cost of readability).

The mapped() method can also be called with a function as argument. In this case, it returns a list containing the result of the function applied to each record of self, or the union of the recordsets returned by the function, if the function returns a recordset.

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

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