[FIX] mail: exclude portal user from the DM search

Before this commit, a user could DM a portal user.
Portal user are not supported and can't chat.

task-2632874

closes odoo/odoo#77568

X-original-commit: a7eda6d7314e7261ddda32620fae817f1d828bae
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit is contained in:
Didier (did)
2021-09-30 19:42:15 +00:00
parent fe8f8eacf0
commit db4e07e52e
+1
View File
@@ -237,6 +237,7 @@ class Partner(models.Model):
WHERE P.name ILIKE %s
AND P.id NOT IN %s
AND U.active = 't'
AND U.share IS NOT TRUE
ORDER BY P.name ASC, P.id ASC
LIMIT %s
""", ("%s seconds" % DISCONNECTION_TIMER, "%s seconds" % AWAY_TIMER, name, tuple(excluded_partner_ids), limit))