Sunday, August 23, 2026
1 change · saas-18.4
Resolved issues and error corrections
Mentions in Odoo Discuss now choose an active user account for each recipient instead of potentially selecting an archived account. This helps ensure people actually receive inbox notifications when they are mentioned, reducing missed internal communication.
Original PR description
Before this commit, mentioning a partner that has an archived user sent the inbox notification to that archived user, so the mentioned person never saw the mention. This happens because the query picking the user of a recipient joins res_users without filtering on active, and keeps one row per partner with DISTINCT ON and no ORDER BY, so which row survives is arbitrary. One solution could have been to keep every active user of the partner, which is what we want as each of them has its own notification type, but a notification is stored per partner, so the type of a single user applies to all of them. Picking one user is a current limitation. This commit fixes the issue by taking the first active user of each partner in a lateral join, ordered as mail.followers._get_recipient_data already does: internal users first, then the lowest id. Forward-Port-Of: odoo/odoo#283914 Forward-Port-Of: odoo/odoo#283806