odoo/enterprise#85477

Created by fw-bot
Merged at 79969b588cd0cafe3651ddec2c43edc7c447a484

Statuses:

Linked pull requests
label
odoo-dev:master-saas-18.2-appointment-pivi-435739-fw
head
96c031f83a0b5ba7c89a68d209762ec93c467256
merged
1 year ago by Framework (ORM), Piryns Victor (pivi)
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

[FW][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

Forward-Port-Of: #85401
Forward-Port-Of: #83916