Skip to content
Snippets Groups Projects
Commit eff28bd0 authored by Aurelien van Delft (avd)'s avatar Aurelien van Delft (avd)
Browse files

[FIX] base: speedup res_partner's _compute_avatar


Group the res_partners in self by placeholder_path value before
calling __setitem__ on each group. Because placeholders are
independent from the recordset, we can set the value
of res_partner[avatar_field] to a placeholder for a recordset
of partners. When self contains lots of partners without
image_field value, this speeds up the _compute_avatar function
noticeably. This in turn speeds up stuff like loading
the Contacts KanbanView (search_read on res_partner).

Example speedup: In a database without any image for the partners,
search_read for avatar_128 with limit=80: 609ms -> 64ms.

opw-3128771

closes odoo/odoo#113756

Signed-off-by: default avatarRémy Voet <ryv@odoo.com>
parent 2eeab71c
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment