-
- Downloads
[IMP] base: add prefetching group feature
The field prefetching mechanism was poorly customizable. Before this,
we could only tell if a field was prefetched with other fields or not at
all. We have no way to inform the framework, like: "When I need data of
that field, prefetch these other fields, which are likely be used in the
same transaction".
From now on, the `prefetch` attribute is used as a grouping key for
prefetching fields. When a field is fetched, all the fields with the
same value for `prefetch` are taken for prefetching.
For example, consider a small set of fields that are rarely used, except
for one flow A using them. You want to prefetch those fields only in
the flow A, and you want to fetch them in a single query. With the new
feature, simply set `prefetch=A` for some string `A` on those fields,
and they will be grouped for prefetching.
closes odoo/odoo#85220
Signed-off-by:
Rémy Voet <ryv@odoo.com>
Showing
- addons/event/models/event_stage.py 3 additions, 3 deletionsaddons/event/models/event_stage.py
- addons/website/models/mixins.py 3 additions, 3 deletionsaddons/website/models/mixins.py
- odoo/addons/test_new_api/models/test_new_api.py 8 additions, 3 deletionsodoo/addons/test_new_api/models/test_new_api.py
- odoo/addons/test_new_api/security/ir.model.access.csv 1 addition, 1 deletionodoo/addons/test_new_api/security/ir.model.access.csv
- odoo/addons/test_new_api/tests/test_new_fields.py 53 additions, 1 deletionodoo/addons/test_new_api/tests/test_new_fields.py
- odoo/fields.py 1 addition, 1 deletionodoo/fields.py
- odoo/models.py 4 additions, 4 deletionsodoo/models.py
Loading
Please register or sign in to comment