[FIX] mail: channel_get not finding channels correctly
[FIX] mail: channel_get not finding channels correctly

The channel_get method from mail.channel was not retrieving existing
channels between partners correctly in some cases, which caused some
annoyances, like OdooBot creating a new channel/thread each time the
admin user logs in to remind them about changing the default password,
instead of using an existing conversation.

This was caused because because the SQL query was filtering the channels
by comparing the partner ids to the result of the ARRAY_AGG function,
which sometimes contains duplicates.

Task ID: 2233014
PR #49661
ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo