Skip to content
Snippets Groups Projects
Commit 164a1157 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#122840

X-original-commit: 34e97b4c65b7392576d94b870e22e74df14f9dd2
Signed-off-by: default avatarRémy Voet <ryv@odoo.com>
parent 79232a4c
No related branches found
No related tags found
No related merge requests found
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