summaryrefslogtreecommitdiff
path: root/addons/test_mail/tests
diff options
context:
space:
mode:
authormgh-odoo <mgh@odoo.com>2019-07-31 12:51:10 +0000
committerAlexandre Kühn <aku@odoo.com>2020-02-05 09:59:52 +0000
commit4da64b3f3c8dff88d8e0e01c65374590cc0bf4f7 (patch)
treecfc7d9b87178feffb10dc2a9fea563fcb6c4f186 /addons/test_mail/tests
parent474643b1c1341d8f5956e7a18bfde14ff0e9d662 (diff)
[IMP] mail: email channels duplicated notifications
This commit prevents sending a notification within Odoo when a message is posted from a mailing channel to a user whose notification management preference is set to "Handle by Emails". Task-ID 2033302 closes odoo/odoo#36000 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Diffstat (limited to 'addons/test_mail/tests')
-rw-r--r--addons/test_mail/tests/test_mail_channel.py1
-rw-r--r--addons/test_mail/tests/test_performance.py2
2 files changed, 2 insertions, 1 deletions
diff --git a/addons/test_mail/tests/test_mail_channel.py b/addons/test_mail/tests/test_mail_channel.py
index 2e3c7c2cb4b..e14fd727eae 100644
--- a/addons/test_mail/tests/test_mail_channel.py
+++ b/addons/test_mail/tests/test_mail_channel.py
@@ -161,6 +161,7 @@ class TestChannelFeatures(TestMailCommon):
""" Posting a message on a mailing list should send one email to all recipients """
self.env['ir.config_parameter'].set_param('mail.catchall.domain', 'schlouby.fr')
self.test_channel.write({'email_send': True})
+ self.user_employee.write({'notification_type': 'email'})
# Subscribe an user without email. We shouldn't try to send email to them.
nomail = self.env['res.users'].create({
diff --git a/addons/test_mail/tests/test_performance.py b/addons/test_mail/tests/test_performance.py
index 31c93f4a0fa..79058b69b6a 100644
--- a/addons/test_mail/tests/test_performance.py
+++ b/addons/test_mail/tests/test_performance.py
@@ -817,7 +817,7 @@ class TestMailHeavyPerformancePost(BaseMailPerformance):
]
self.attachements = self.env['ir.attachment'].with_user(self.env.user).create(self.vals)
attachement_ids = self.attachements.ids
- with self.assertQueryCount(emp=92):
+ with self.assertQueryCount(emp=98):
self.cr.sql_log = self.warm and self.cr.sql_log_count
record.with_context({}).message_post(
body='<p>Test body <img src="cid:cid1"> <img src="cid:cid2"></p>',