diff options
| author | Denis Ledoux <dle@odoo.com> | 2019-02-04 14:47:50 +0000 |
|---|---|---|
| committer | Raphael Collet <rco@odoo.com> | 2019-02-11 16:22:01 +0000 |
| commit | 36551615b7265ad83dbf9d1207ff9ee59b7069f3 (patch) | |
| tree | 0c75ff90ee896ea5bf66db4fcb65a8d9bb603784 /addons/web/static/src/js/views/basic/basic_controller.js | |
| parent | cb0e8831f94fd618079403ee0c137e9a93363147 (diff) | |
[IMP] read, cache: faster read by updating the cache by fields
instead of updating the cache by records.
We use `cr.fetchall()` and `zip` to get the values by field, which is more
convenient to be stored in cache.
Result of `cr.fetchall()`:
```
[
(3, 'Marc Demo', 'demo@example.com', '032'),
(1, 'Mitchell Admin', 'admin@example.com', '001'),
]
```
After being grouped by field:
```
[
[3, 1],
['Marc Demo', 'Mitchell Admin],
['demo@example.com', 'admin@example.com'],
['032', '001'],
]
```
That way we can update the cache of a field for all records at once, by calling
the builtin `update` method of `dict` with the `zip` of record ids and
corresponding values.
This significantly speeds up the storage of field values in the cache.
closes odoo/odoo#30817
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_controller.js')
0 files changed, 0 insertions, 0 deletions
