Compare commits

...

1 Commits

Author SHA1 Message Date
Raphael Collet
6677c1edc8 [IMP] core: introduce search_fetch() and fetch() 2023-03-07 17:09:31 +01:00
2 changed files with 19 additions and 0 deletions

View File

@@ -615,6 +615,12 @@ for partners and one for countries::
country = partner.country_id # first pass prefetches all partners
countries.add(country.name) # first pass prefetches all countries
.. seealso::
The methods :meth:`~odoo.models.Model.search_fetch` and
:meth:`~odoo.models.Model.fetch` can be used to populate the cache of
records, typically in cases where the prefetching mechanism does not work
well.
.. _reference/api/decorators:
@@ -845,8 +851,12 @@ Search/Read
.. automethod:: Model.search_count
.. automethod:: Model.search_fetch
.. automethod:: Model.name_search
.. automethod:: Model.fetch
.. automethod:: Model.read
.. automethod:: Model.read_group

View File

@@ -4,6 +4,15 @@
Changelog
=========
Odoo Online version 16.2
========================
- Refactor the implementation of searching and reading methods to be able to
combine both in a minimal number of SQL queries. We introduce two new methods
`odoo.models.Model.search_fetch` and `odoo.models.Model.fetch` that take
advantage of the combination. More details can be found on the pull request
`#112126 <https://github.com/odoo/odoo/pull/112126>`_.
Odoo version 16.0
=================