-
- Downloads
[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#40651 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>
Loading
Please register or sign in to comment