summaryrefslogtreecommitdiff
path: root/addons/mail
diff options
context:
space:
mode:
authorbit-odoo <bit@odoo.com>2021-03-12 17:14:29 +0000
committerSébastien Theys <seb@odoo.com>2021-03-12 17:14:29 +0000
commit52acbfa5c4c6ef6eedfbe876da8817c8c41cbb42 (patch)
tree907db88931aea9819e295c7a27b71bc3c191737c /addons/mail
parentf0a1e7c35bd8cd17149d1d54bfe5b9eec12a0814 (diff)
[FIX] mail, test_mail: avoid removing chat users on archive/delete
Before this commit: When deleting/archiving any user, the user’s related chat changed name due to losing one of its members. After this commit: Chat name should remain the same after archiving/deleting the user. Reasoning: The unsubscribe was meant to target channels of type channel specifically. `test_channel_auto_unsubscribe_archived_or_deleted_users` has been reintroduced after having been removed by mistake in eda542c82f84d7b5589846691b9cb6b7f1021947 task-2442235 closes odoo/odoo#67694 X-original-commit: 7844ed0a5fcf4a2139c355b8e640ba50ec818527 Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Diffstat (limited to 'addons/mail')
-rw-r--r--addons/mail/models/res_users.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/mail/models/res_users.py b/addons/mail/models/res_users.py
index ba8e9def72d..bd4a3f5bfd3 100644
--- a/addons/mail/models/res_users.py
+++ b/addons/mail/models/res_users.py
@@ -109,7 +109,7 @@ GROUP BY channel_moderator.res_users_id""", [tuple(self.ids)])
public channels are mailing list (e-mail based) and so users should always receive
updates from public channels until they manually un-subscribe themselves.
"""
- self.mapped('partner_id.channel_ids').filtered(lambda c: c.public != 'public').write({
+ self.mapped('partner_id.channel_ids').filtered(lambda c: c.public != 'public' and c.channel_type == 'channel').write({
'channel_partner_ids': [(3, pid) for pid in self.mapped('partner_id').ids]
})