diff options
| author | Raphael Collet <rco@odoo.com> | 2019-11-21 15:35:38 +0000 |
|---|---|---|
| committer | Raphael Collet <rco@odoo.com> | 2019-11-25 09:04:19 +0000 |
| commit | d49e6b91a72d2824df1bd723bac982881893186b (patch) | |
| tree | becc3057bd24f6ba282618c8a5385c10cc2762a9 /addons/web/static/lib/jquery.mjs.nestedSortable/jquery.mjs.nestedSortable.js | |
| parent | 305c06470ebc6497fb3d1dfa9c9eb30383064538 (diff) | |
[FIX] fields: do not prefetch fields translated with a callable
This is a performance fix. It avoids the cost of XML/HTML translations
for fields that may not be necessary when prefetching fields on records.
This patch marks such fields as non-prefetchable by default.
The code that changes the attribute `translate` on HTML fields (from
`translate=True` to `translate=html_translate`) has been adapted to
allow the setup of textual fields to mark the field as non-prefetchable.
Jairo Llopis made a comparative benchmark: evaluating `name_get` on
`event.event` records. The method needs the field `name` and without
the patch, the prefetching mechanism reads the translated HTML field
`description` as well. This patch speeds up the benchmark from 5800ms
to 800ms (see https://github.com/odoo/odoo/pull/37967#issuecomment-538364011).
closes odoo/odoo#40771
X-original-commit: e5ee5e5b65f85d66c8d59594ead9eece172c4282
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Co-authored-by: Pedro Baeza <pedro.baeza@tecnativa.com>
Co-authored-by: Jairo Llopis <jairo.llopis@tecnativa.com>
Diffstat (limited to 'addons/web/static/lib/jquery.mjs.nestedSortable/jquery.mjs.nestedSortable.js')
0 files changed, 0 insertions, 0 deletions
