odoo/enterprise#83916

Created by Framework (ORM), Piryns Victor (pivi)
Merged at 904d5bb1d2040b735656e1fb7570bcee967f9e94

Statuses:

Linked pull requests
label
odoo-dev:saas-18.2-appointment-pivi
head
0b7c979c4fda927d14fc7ef36f3cc19b35ae1776
merged
1 year ago by SM Customer, Jérémy Hennecart (jeh)
odoo/odoo odoo/enterprise
saas-18.2 #207015 #83916
saas-18.3 #209713 #85401
saas-18.4
19.0
saas-19.1
saas-19.2
saas-19.3
master #209898 #85477

[PERF] appointment: Speed up loading of the default kanban view

Description

For non-admin users, loading the default kanban view of the Appointment application triggers the compute method
_compute_appointment_counts. This is quite slow as it calls an override of _read_group, which adds an elaborate domain for privacy in _get_default_privacy_domain.

This patch optimizes domains to generate more efficient queries by:

Benchmark

On odoo.com, the time for a regular user to open the default kanban view of appointments is:

Before (hot) After (hot) Speedup
11s 1.2s 9.2x

Reference

task-4744275
Community PR: odoo/odoo#207015