summaryrefslogtreecommitdiff
path: root/addons/test_mail/tests/test_performance.py
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2018-02-14 14:34:24 +0100
committerThibault Delavallée <tde@odoo.com>2018-02-26 14:11:32 +0100
commit97ee12e9c7cca4ac9a83b357b00d4d212f652efd (patch)
tree9a8e550490044d68788e9b9fe25f4a31af18ceac /addons/test_mail/tests/test_performance.py
parent74d4b3902d51bf805f87bfd853f54407137b0ac3 (diff)
[REF] mail: simplify parent fetch when posting a message
1d57a09112e4def7c7ed9cc010f9d683c18ac1ea added a two-steps parent fetch when posting a message on a discussion thread. At the time this commit was done responsible were notified of the first thread message. It was helpful to notify them of the original email that created the thread instead of the "document created" generic message. Indeed for documents like leads or issues having the original email containing the customer question is interesting when being notified. This is why this commit was done. However since quite a long time responsible notifications have changed. They now receive an email notification telling they have been assigned on a document. This commit is not necessary anymore and we therefore remove it in order to clean a bit the message_post process. This commit globally reverts 1d57a09112e4def7c7ed9cc010f9d683c18ac1ea. Please note that @beledouxdenis agreed after a long thinking. This commit has a slight impact on mail performance tests, allowing to save one query in some more complex test case.
Diffstat (limited to 'addons/test_mail/tests/test_performance.py')
-rw-r--r--addons/test_mail/tests/test_performance.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/addons/test_mail/tests/test_performance.py b/addons/test_mail/tests/test_performance.py
index 20236364df9..eeef3e2519d 100644
--- a/addons/test_mail/tests/test_performance.py
+++ b/addons/test_mail/tests/test_performance.py
@@ -243,7 +243,7 @@ class TestHeavyMailPerformance(TransactionCase):
self.umbrella.message_subscribe(self.user_portal.partner_id.ids)
record = self.umbrella.sudo(self.env.user)
- with self.assertQueryCount(admin=124, emp=157): # com runbot 122 - 155 // test_mail only: 118 - 150
+ with self.assertQueryCount(admin=123, emp=156): # com runbot 121 - 154 // test_mail only: 117 - 149
record.message_post(
body='<p>Test Post Performances</p>',
message_type='comment',
@@ -260,7 +260,7 @@ class TestHeavyMailPerformance(TransactionCase):
record = self.umbrella.sudo(self.env.user)
template_id = self.env.ref('test_mail.mail_test_tpl').id
- with self.assertQueryCount(admin=149, emp=197): # com runbot 147 - 195 // test_mail only: 141 - 187
+ with self.assertQueryCount(admin=148, emp=196): # com runbot 146 - 194 // test_mail only: 140 - 186
record.message_post_with_template(template_id, message_type='comment', composition_mode='comment')
self.assertEqual(record.message_ids[0].body, '<p>Adding stuff on %s</p>' % record.name)
@@ -276,7 +276,7 @@ class TestHeavyMailPerformance(TransactionCase):
customer_id = self.customer.id
user_id = self.user_portal.id
- with self.assertQueryCount(admin=336, emp=398): # test_mail only: 323 - 383
+ with self.assertQueryCount(admin=335, emp=397): # test_mail only: 322 - 382
rec = self.env['mail.test.full'].create({
'name': 'Test',
'umbrella_id': umbrella_id,
@@ -315,7 +315,7 @@ class TestHeavyMailPerformance(TransactionCase):
})
self.assertEqual(rec.message_partner_ids, self.user_portal.partner_id | self.env.user.partner_id)
- with self.assertQueryCount(admin=239, emp=279): # test_mail only: 233 - 271
+ with self.assertQueryCount(admin=238, emp=278): # test_mail only: 231 - 270
rec.write({
'name': 'Test2',
'umbrella_id': umbrella_id,