Because we now check groups in the domain, some searches raise `AccessError` when using `message_partner_ids` in the domain for the portal user: - https://github.com/odoo/odoo/blob/4d1a1f1c99d6055b60921ce464b72f0f4d9bbfe2/addons/sale/controllers/portal.py#L35 - https://github.com/odoo/odoo/blob/4d1a1f1c99d6055b60921ce464b72f0f4d9bbfe2/addons/sale/controllers/portal.py#L41 - https://github.com/odoo/odoo/blob/ba1a5509fa49fd846739252d16083dd8cb334b53/addons/website_forum/models/forum_post.py#L831 - https://github.com/odoo/odoo/blob/86b43bcfa6c9a5b6ac1b3ac9ba0c308f1169ea3b/addons/hr_timesheet/models/hr_timesheet.py#L41 Since there are many invalid domains and it is impossible to sudo only part of the domain, it is easier to override `_flush_search` to allow `message_partner_ids` in search domain leafs with some restriction. closes odoo/odoo#135111 Related: odoo/enterprise#47822 Signed-off-by: Raphael Collet <rco@odoo.com>