diff options
| author | XavierDo <xdo@odoo.com> | 2018-11-19 10:21:36 +0000 |
|---|---|---|
| committer | XavierDo <xdo@odoo.com> | 2018-11-28 11:35:12 +0000 |
| commit | 136fee6fcf976cc7b23a699732b832d643473fdd (patch) | |
| tree | 1b5a243a2a5efa7695fb016761133ae97f2298f6 /addons/test_mail/tests/test_odoobot.py | |
| parent | db21ef75783af1c90cfa966130c976bc138b58c0 (diff) | |
[FIX] mail_bot: only display odoobot once in mention suggestions
Before this commit odoobot was appearing twice in mention
suggestions when talking to odoobot.
The initial need to be able to ping odoobot from everywhere led to the
override of channel_fetch_listeners. This is not usefull anymore.
This fix simply removes this override to avoid this problem since we
don't have a real use case where we need to ping odoobot in another
channel.
Task 1907142
closes odoo/odoo#28791
Diffstat (limited to 'addons/test_mail/tests/test_odoobot.py')
| -rw-r--r-- | addons/test_mail/tests/test_odoobot.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/addons/test_mail/tests/test_odoobot.py b/addons/test_mail/tests/test_odoobot.py index 50170f91604..07cdfaa0d3a 100644 --- a/addons/test_mail/tests/test_odoobot.py +++ b/addons/test_mail/tests/test_odoobot.py @@ -25,6 +25,14 @@ class TestOdoobot(BaseFunctionalTest, MockEmails, TestRecipients): self.test_record_employe = self.test_record.sudo(self.user_employee) @mute_logger('odoo.addons.mail.models.mail_mail') + def test_fetch_listener(self): + channel = self.env['mail.channel'].sudo(self.user_employee).init_odoobot() + partners = self.env['mail.channel'].channel_fetch_listeners(channel.uuid) + odoobot = self.env.ref("base.partner_root") + odoobot_in_fetch_listeners = [partner for partner in partners if partner['id'] == odoobot.id] + self.assertEqual(len(odoobot_in_fetch_listeners), 1, 'odoobot should appear only once in channel_fetch_listeners') + + @mute_logger('odoo.addons.mail.models.mail_mail') def test_odoobot_ping(self): kwargs = self.message_post_default_kwargs.copy() kwargs.update({'body': self.odoobot_ping_body, 'partner_ids': [self.odoobot.id, self.user_admin.partner_id.id]}) |
