[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:
Rémy Voet <ryv@odoo.com>
Loading
Please register or sign in to comment