From 4da64b3f3c8dff88d8e0e01c65374590cc0bf4f7 Mon Sep 17 00:00:00 2001 From: mgh-odoo Date: Wed, 31 Jul 2019 12:51:10 +0000 Subject: [IMP] mail: email channels duplicated notifications MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- addons/test_mail/tests/test_mail_channel.py | 1 + addons/test_mail/tests/test_performance.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'addons/test_mail') 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='

Test body

', -- cgit v1.2.3