diff --git a/addons/test_mail/tests/common.py b/addons/test_mail/tests/common.py
index c7b2e4af8e3..09f81fda7d7 100644
--- a/addons/test_mail/tests/common.py
+++ b/addons/test_mail/tests/common.py
@@ -31,8 +31,8 @@ class BaseFunctionalTest(common.SavepointCase):
'notification_type': 'email',
'groups_id': [(6, 0, [user_group_employee.id])]})
cls.partner_employee = cls.user_employee.partner_id
- cls.user_admin = cls.env.user
- cls.partner_admin = cls.user_admin.partner_id
+ cls.user_admin = cls.env.ref('base.user_admin')
+ cls.partner_admin = cls.env.ref('base.partner_admin')
cls.channel_listen = cls.env['mail.channel'].with_context(cls._quick_create_ctx).create({'name': 'Listener'})
diff --git a/addons/test_mail/tests/test_discuss.py b/addons/test_mail/tests/test_discuss.py
index 3a3cb21d043..907f95be0e7 100644
--- a/addons/test_mail/tests/test_discuss.py
+++ b/addons/test_mail/tests/test_discuss.py
@@ -119,7 +119,7 @@ class TestNotifications(BaseFunctionalTest, MockEmails):
message.sudo(user_portal).set_message_done()
def test_set_star(self):
- msg = self.test_record.message_post(body='My Body', subject='1')
+ msg = self.test_record.sudo(self.user_admin).message_post(body='My Body', subject='1')
msg_emp = self.env['mail.message'].sudo(self.user_employee).browse(msg.id)
# Admin set as starred
diff --git a/addons/test_mail/tests/test_ir_actions.py b/addons/test_mail/tests/test_ir_actions.py
index f54b07b18e0..36ff2a5094e 100644
--- a/addons/test_mail/tests/test_ir_actions.py
+++ b/addons/test_mail/tests/test_ir_actions.py
@@ -28,11 +28,11 @@ class TestServerActionsEmail(TestServerActionsBase):
self.test_partner.message_unsubscribe(self.test_partner.message_partner_ids.ids)
self.action.write({
'state': 'followers',
- 'partner_ids': [(4, self.env.ref('base.partner_root').id), (4, self.env.ref('base.partner_demo').id)],
+ 'partner_ids': [(4, self.env.ref('base.partner_admin').id), (4, self.env.ref('base.partner_demo').id)],
'channel_ids': [(4, self.env.ref('mail.channel_all_employees').id)]
})
self.action.with_context(self.context).run()
- self.assertEqual(self.test_partner.message_partner_ids, self.env.ref('base.partner_root') | self.env.ref('base.partner_demo'))
+ self.assertEqual(self.test_partner.message_partner_ids, self.env.ref('base.partner_admin') | self.env.ref('base.partner_demo'))
self.assertEqual(self.test_partner.message_channel_ids, self.env.ref('mail.channel_all_employees'))
def test_action_next_activity(self):
diff --git a/addons/test_mail/tests/test_mail_followers.py b/addons/test_mail/tests/test_mail_followers.py
index 20e94c288fd..06b0b183197 100644
--- a/addons/test_mail/tests/test_mail_followers.py
+++ b/addons/test_mail/tests/test_mail_followers.py
@@ -178,7 +178,6 @@ class AdvancedFollowersTest(common.BaseFunctionalTest):
'name': 'Test',
'user_id': self.user_admin.id,
})
-
self.assertEqual(sub.message_partner_ids, (self.user_employee.partner_id | self.user_admin.partner_id))
def test_auto_subscribe_defaults(self):
diff --git a/addons/test_mail/tests/test_mail_resend.py b/addons/test_mail/tests/test_mail_resend.py
index 21790062488..973212b8611 100644
--- a/addons/test_mail/tests/test_mail_resend.py
+++ b/addons/test_mail/tests/test_mail_resend.py
@@ -88,7 +88,7 @@ class TestMailResend(common.BaseFunctionalTest, common.MockEmails):
def connect_failure(**kwargs):
raise Exception
with patch.object(IrMailServer, 'connect', side_effect=connect_failure):
- message = self.test_record.sudo().message_post(partner_ids=self.partners.ids, subtype='mail.mt_comment', message_type='notification')
+ message = self.test_record.sudo(self.user_admin).message_post(partner_ids=self.partners.ids, subtype='mail.mt_comment', message_type='notification')
self.assertBusMessage([self.partner_admin])
self.assertEmails(self.partner_admin, [])
self.assertNotifStates(('exception', 'exception', 'exception', 'exception'), message)
@@ -113,12 +113,12 @@ class TestMailResend(common.BaseFunctionalTest, common.MockEmails):
def test_mail_send_no_failure(self):
self.user1.write({"email": 'u1@example.com'})
self.partner1.write({"email": 'p1@example.com'})
- message = self.test_record.sudo().message_post(partner_ids=self.partners.ids, subtype='mail.mt_comment', message_type='notification')
+ message = self.test_record.sudo(self.user_admin).message_post(partner_ids=self.partners.ids, subtype='mail.mt_comment', message_type='notification')
self.assertBusMessage([]) # one update for cancell
@mute_logger('odoo.addons.mail.models.mail_mail')
def test_remove_mail_become_canceled(self):
- message = self.test_record.sudo().message_post(partner_ids=self.partners.ids, subtype='mail.mt_comment', message_type='notification')
+ message = self.test_record.sudo(self.user_admin).message_post(partner_ids=self.partners.ids, subtype='mail.mt_comment', message_type='notification')
self.assertEmails(self.partner_admin, self.partners)
self.assertBusMessage([self.partner_admin] * 2) # two failure sent on bus, one for each mail
wizard = self.env['mail.resend.message'].with_context({'mail_message_to_resend': message.id}).create({})
@@ -132,7 +132,7 @@ class TestMailResend(common.BaseFunctionalTest, common.MockEmails):
@mute_logger('odoo.addons.mail.models.mail_mail')
def test_cancel_all(self):
- message = self.test_record.sudo().message_post(partner_ids=self.partners.ids, subtype='mail.mt_comment', message_type='notification')
+ message = self.test_record.sudo(self.user_admin).message_post(partner_ids=self.partners.ids, subtype='mail.mt_comment', message_type='notification')
self.assertNotifStates(('exception', 'sent', 'exception', 'sent'), message)
self.assertBusMessage([self.partner_admin] * 2)
wizard = self.env['mail.resend.message'].with_context({'mail_message_to_resend': message.id}).create({})
diff --git a/addons/test_mail/tests/test_performance.py b/addons/test_mail/tests/test_performance.py
index 4320f89eaab..7b170ef2c31 100644
--- a/addons/test_mail/tests/test_performance.py
+++ b/addons/test_mail/tests/test_performance.py
@@ -26,14 +26,14 @@ class TestMailPerformance(TransactionCase):
'groups_id': [(6, 0, [self.env.ref('base.group_user').id])],
})
- @users('admin', 'demo')
+ @users('__system__', 'demo')
@warmup
def test_read_mail(self):
""" Read records inheriting from 'mail.thread'. """
records = self.env['test_performance.mail'].search([])
self.assertEqual(len(records), 5)
- with self.assertQueryCount(admin=3, demo=3):
+ with self.assertQueryCount(__system__=3, demo=3):
# without cache
for record in records:
record.partner_id.country_id.name
@@ -48,27 +48,27 @@ class TestMailPerformance(TransactionCase):
for record in records:
record.value_pc
- @users('admin', 'demo')
+ @users('__system__', 'demo')
@warmup
def test_write_mail(self):
""" Write records inheriting from 'mail.thread' (no recomputation). """
records = self.env['test_performance.mail'].search([])
self.assertEqual(len(records), 5)
- with self.assertQueryCount(admin=3, demo=3): # test_mail only: 3 - 3
+ with self.assertQueryCount(__system__=3, demo=3): # test_mail only: 3 - 3
records.write({'name': 'X'})
- @users('admin', 'demo')
+ @users('__system__', 'demo')
@warmup
def test_write_mail_with_recomputation(self):
""" Write records inheriting from 'mail.thread' (with recomputation). """
records = self.env['test_performance.mail'].search([])
self.assertEqual(len(records), 5)
- with self.assertQueryCount(admin=5, demo=5): # test_mail only: 5 - 5
+ with self.assertQueryCount(__system__=5, demo=5): # test_mail only: 5 - 5
records.write({'value': 42})
- @users('admin', 'demo')
+ @users('__system__', 'demo')
@warmup
def test_write_mail_with_tracking(self):
""" Write records inheriting from 'mail.thread' (with field tracking). """
@@ -79,36 +79,36 @@ class TestMailPerformance(TransactionCase):
'partner_id': self.env.ref('base.res_partner_12').id,
})
- with self.assertQueryCount(admin=5, demo=5): # test_mail only: 5 - 5
+ with self.assertQueryCount(__system__=5, demo=5): # test_mail only: 5 - 5
record.track = 'X'
- @users('admin', 'demo')
+ @users('__system__', 'demo')
@warmup
def test_create_mail(self):
""" Create records inheriting from 'mail.thread' (without field tracking). """
model = self.env['test_performance.mail']
- with self.assertQueryCount(admin=3, demo=3): # test_mail only: 3 - 3
+ with self.assertQueryCount(__system__=3, demo=3): # test_mail only: 3 - 3
model.with_context(tracking_disable=True).create({'name': 'X'})
- @users('admin', 'demo')
+ @users('__system__', 'demo')
@warmup
def test_create_mail_with_tracking(self):
""" Create records inheriting from 'mail.thread' (with field tracking). """
- with self.assertQueryCount(admin=13, demo=13): # test_mail only: 13 - 13
+ with self.assertQueryCount(__system__=13, demo=13): # test_mail only: 13 - 13
self.env['test_performance.mail'].create({'name': 'X'})
- @users('admin', 'emp')
+ @users('__system__', 'emp')
@warmup
def test_create_mail_simple(self):
- with self.assertQueryCount(admin=8, emp=8): # test_mail only: 8 - 8
+ with self.assertQueryCount(__system__=8, emp=8): # test_mail only: 8 - 8
self.env['mail.test.simple'].create({'name': 'Test'})
- @users('admin', 'emp')
+ @users('__system__', 'emp')
@warmup
def test_write_mail_simple(self):
rec = self.env['mail.test.simple'].create({'name': 'Test'})
- with self.assertQueryCount(admin=1, emp=1): # test_mail only: 1 - 1
+ with self.assertQueryCount(__system__=1, emp=1): # test_mail only: 1 - 1
rec.write({
'name': 'Test2',
'email_from': 'test@test.com',
@@ -149,15 +149,15 @@ class TestAdvMailPerformance(TransactionCase):
# automatically follow activities, for backward compatibility concerning query count
self.env.ref('mail.mt_activities').write({'default': True})
- @users('admin', 'emp')
+ @users('__system__', 'emp')
@warmup
def test_adv_activity(self):
model = self.env['mail.test.activity']
- with self.assertQueryCount(admin=9, emp=8): # test_mail only: 8 - 8
+ with self.assertQueryCount(__system__=9, emp=8): # test_mail only: 8 - 8
model.create({'name': 'Test'})
- @users('admin', 'emp')
+ @users('__system__', 'emp')
@warmup
@mute_logger('odoo.models.unlink')
def test_adv_activity_full(self):
@@ -166,7 +166,7 @@ class TestAdvMailPerformance(TransactionCase):
'default_res_model': 'mail.test.activity',
})
- with self.assertQueryCount(admin=10, emp=15): # test_mail only: 9 - 13
+ with self.assertQueryCount(__system__=10, emp=15): # test_mail only: 9 - 13
activity = MailActivity.create({
'summary': 'Test Activity',
'res_id': record.id,
@@ -176,16 +176,16 @@ class TestAdvMailPerformance(TransactionCase):
#voip module read activity_type during create leading to one less query in enterprise on action_feedback
category = activity.activity_type_id.category
- with self.assertQueryCount(admin=26, emp=46): # test_mail only: 27 - 47
+ with self.assertQueryCount(__system__=26, emp=46): # test_mail only: 27 - 47
activity.action_feedback(feedback='Zizisse Done !')
- @users('admin', 'emp')
+ @users('__system__', 'emp')
@warmup
@mute_logger('odoo.models.unlink')
def test_adv_activity_mixin(self):
record = self.env['mail.test.activity'].create({'name': 'Test'})
- with self.assertQueryCount(admin=10, emp=15): # test_mail only: 9 - 13
+ with self.assertQueryCount(__system__=10, emp=15): # test_mail only: 9 - 13
activity = record.action_start('Test Start')
#read activity_type to normalize cache between enterprise and community
#voip module read activity_type during create leading to one less query in enterprise on action_close
@@ -193,60 +193,60 @@ class TestAdvMailPerformance(TransactionCase):
record.write({'name': 'Dupe write'})
- with self.assertQueryCount(admin=28, emp=48): # test_mail only: 29 - 49
+ with self.assertQueryCount(__system__=28, emp=48): # test_mail only: 29 - 49
record.action_close('Dupe feedback')
self.assertEqual(record.activity_ids, self.env['mail.activity'])
@mute_logger('odoo.addons.mail.models.mail_mail', 'odoo.models.unlink')
- @users('admin', 'emp')
+ @users('__system__', 'emp')
@warmup
def test_message_assignation_email(self):
self.user_test.write({'notification_type': 'email'})
record = self.env['mail.test.track'].create({'name': 'Test'})
- with self.assertQueryCount(admin=56, emp=75): # com runbot: 56 - 75 // test_mail only: 56 - 75
+ with self.assertQueryCount(__system__=56, emp=75): # com runbot: 56 - 75 // test_mail only: 56 - 75
record.write({
'user_id': self.user_test.id,
})
- @users('admin', 'emp')
+ @users('__system__', 'emp')
@warmup
def test_message_assignation_inbox(self):
record = self.env['mail.test.track'].create({'name': 'Test'})
- with self.assertQueryCount(admin=36, emp=47): # test_mail only: 43 - 54
+ with self.assertQueryCount(__system__=36, emp=47): # test_mail only: 43 - 54
record.write({
'user_id': self.user_test.id,
})
- @users('admin', 'emp')
+ @users('__system__', 'emp')
@warmup
def test_message_log(self):
record = self.env['mail.test.simple'].create({'name': 'Test'})
- with self.assertQueryCount(admin=2, emp=2): # test_mail only: 2 - 2
+ with self.assertQueryCount(__system__=2, emp=2): # test_mail only: 2 - 2
record._message_log(
body='Test _message_log
',
message_type='comment')
- @users('admin', 'emp')
+ @users('__system__', 'emp')
@warmup
def test_message_log_with_post(self):
record = self.env['mail.test.simple'].create({'name': 'Test'})
- with self.assertQueryCount(admin=7, emp=13): # test_mail only: 7 - 13
+ with self.assertQueryCount(__system__=7, emp=13): # test_mail only: 7 - 13
record.message_post(
body='Test message_post as log
',
subtype='mail.mt_note',
message_type='comment')
- @users('admin', 'emp')
+ @users('__system__', 'emp')
@warmup
def test_message_post_no_notification(self):
record = self.env['mail.test.simple'].create({'name': 'Test'})
- with self.assertQueryCount(admin=7, emp=13): # test_mail only: 7 - 13
+ with self.assertQueryCount(__system__=7, emp=13): # test_mail only: 7 - 13
record.message_post(
body='Test Post Performances basic
',
partner_ids=[],
@@ -254,24 +254,24 @@ class TestAdvMailPerformance(TransactionCase):
subtype='mail.mt_comment')
@mute_logger('odoo.addons.mail.models.mail_mail', 'odoo.models.unlink')
- @users('admin', 'emp')
+ @users('__system__', 'emp')
@warmup
def test_message_post_one_email_notification(self):
record = self.env['mail.test.simple'].create({'name': 'Test'})
- with self.assertQueryCount(admin=48, emp=68): # com runbot: 45 - 65 // test_mail only: 48 - 68
+ with self.assertQueryCount(__system__=48, emp=68): # com runbot: 45 - 65 // test_mail only: 48 - 68
record.message_post(
body='Test Post Performances with an email ping
',
partner_ids=self.customer.ids,
message_type='comment',
subtype='mail.mt_comment')
- @users('admin', 'emp')
+ @users('__system__', 'emp')
@warmup
def test_message_post_one_inbox_notification(self):
record = self.env['mail.test.simple'].create({'name': 'Test'})
- with self.assertQueryCount(admin=31, emp=42): # com runbot 30 - 41 // test_mail only: 31 - 42
+ with self.assertQueryCount(__system__=31, emp=42): # com runbot 30 - 41 // test_mail only: 31 - 42
record.message_post(
body='Test Post Performances with an inbox ping
',
partner_ids=self.user_test.partner_id.ids,
@@ -279,28 +279,28 @@ class TestAdvMailPerformance(TransactionCase):
subtype='mail.mt_comment')
@mute_logger('odoo.models.unlink')
- @users('admin', 'emp')
+ @users('__system__', 'emp')
@warmup
def test_message_subscribe_default(self):
record = self.env['mail.test.simple'].create({'name': 'Test'})
- with self.assertQueryCount(admin=7, emp=7): # test_mail only: 6 - 6
+ with self.assertQueryCount(__system__=7, emp=7): # test_mail only: 6 - 6
record.message_subscribe(partner_ids=self.user_test.partner_id.ids)
- with self.assertQueryCount(admin=3, emp=3): # test_mail only: 2 - 2
+ with self.assertQueryCount(__system__=3, emp=3): # test_mail only: 2 - 2
record.message_subscribe(partner_ids=self.user_test.partner_id.ids)
@mute_logger('odoo.models.unlink')
- @users('admin', 'emp')
+ @users('__system__', 'emp')
@warmup
def test_message_subscribe_subtypes(self):
record = self.env['mail.test.simple'].create({'name': 'Test'})
subtype_ids = (self.env.ref('test_mail.st_mail_test_simple_external') | self.env.ref('mail.mt_comment')).ids
- with self.assertQueryCount(admin=6, emp=6): # test_mail only: 5 - 5
+ with self.assertQueryCount(__system__=6, emp=6): # test_mail only: 5 - 5
record.message_subscribe(partner_ids=self.user_test.partner_id.ids, subtype_ids=subtype_ids)
- with self.assertQueryCount(admin=2, emp=2): # test_mail only: 1 - 1
+ with self.assertQueryCount(__system__=2, emp=2): # test_mail only: 1 - 1
record.message_subscribe(partner_ids=self.user_test.partner_id.ids, subtype_ids=subtype_ids)
@@ -333,7 +333,6 @@ class TestHeavyMailPerformance(TransactionCase):
})
self.admin = self.env.user
- self.admin.login = 'admin'
# setup mail gateway
self.env['ir.config_parameter'].sudo().set_param('mail.catchall.domain', 'example.com')
@@ -364,7 +363,7 @@ class TestHeavyMailPerformance(TransactionCase):
)
@mute_logger('odoo.tests', 'odoo.addons.mail.models.mail_mail', 'odoo.models.unlink')
- @users('admin', 'emp')
+ @users('__system__', 'emp')
@warmup
def test_complex_mail_mail_send(self):
message = self.env['mail.message'].sudo().create({
@@ -382,20 +381,20 @@ class TestHeavyMailPerformance(TransactionCase):
})
mail_ids = mail.ids
- with self.assertQueryCount(admin=13, emp=20): # test_mail only: 13 - 20
+ with self.assertQueryCount(__system__=13, emp=20): # test_mail only: 13 - 20
self.env['mail.mail'].browse(mail_ids).send()
self.assertEqual(mail.body_html, 'Test
')
self.assertEqual(mail.reply_to, formataddr(('%s %s' % (self.env.user.company_id.name, self.umbrella.name), 'test-alias@example.com')))
@mute_logger('odoo.tests', 'odoo.addons.mail.models.mail_mail', 'odoo.models.unlink')
- @users('admin', 'emp')
+ @users('__system__', 'emp')
@warmup
def test_complex_message_post(self):
self.umbrella.message_subscribe(self.user_portal.partner_id.ids)
record = self.umbrella.sudo(self.env.user)
- with self.assertQueryCount(admin=80, emp=103): # com runbot 90 - 113 // test_mail only: 97 - 120
+ with self.assertQueryCount(__system__=80, emp=103): # com runbot 90 - 113 // test_mail only: 97 - 120
record.message_post(
body='Test Post Performances
',
message_type='comment',
@@ -405,21 +404,21 @@ class TestHeavyMailPerformance(TransactionCase):
self.assertEqual(record.message_ids[0].needaction_partner_ids, self.partners | self.user_portal.partner_id)
@mute_logger('odoo.tests', 'odoo.addons.mail.models.mail_mail', 'odoo.models.unlink')
- @users('admin', 'emp')
+ @users('__system__', 'emp')
@warmup
def test_complex_message_post_template(self):
self.umbrella.message_subscribe(self.user_portal.partner_id.ids)
record = self.umbrella.sudo(self.env.user)
template_id = self.env.ref('test_mail.mail_test_tpl').id
- with self.assertQueryCount(admin=99, emp=134): # com runbot 109 - 144 // test_mail only: 116 - 151
+ with self.assertQueryCount(__system__=99, emp=134): # com runbot 109 - 144 // test_mail only: 116 - 151
record.message_post_with_template(template_id, message_type='comment', composition_mode='comment')
self.assertEqual(record.message_ids[0].body, 'Adding stuff on %s
' % record.name)
self.assertEqual(record.message_ids[0].needaction_partner_ids, self.partners | self.user_portal.partner_id | self.customer)
@mute_logger('odoo.tests', 'odoo.addons.mail.models.mail_mail', 'odoo.models.unlink')
- @users('admin', 'emp')
+ @users('__system__', 'emp')
@warmup
def test_complex_message_subscribe(self):
pids = self.partners.ids
@@ -437,7 +436,7 @@ class TestHeavyMailPerformance(TransactionCase):
self.assertEqual(rec.message_channel_ids, self.env['mail.channel'])
# subscribe new followers with forced given subtypes
- with self.assertQueryCount(admin=9, emp=9): # test_mail only: 8 - 8
+ with self.assertQueryCount(__system__=9, emp=9): # test_mail only: 8 - 8
rec.message_subscribe(
partner_ids=pids[:4],
channel_ids=cids,
@@ -448,7 +447,7 @@ class TestHeavyMailPerformance(TransactionCase):
self.assertEqual(rec.message_channel_ids, self.channel)
# subscribe existing and new followers with force=False, meaning only some new followers will be added
- with self.assertQueryCount(admin=7, emp=7): # test_mail only: 6 - 6
+ with self.assertQueryCount(__system__=7, emp=7): # test_mail only: 6 - 6
rec.message_subscribe(
partner_ids=pids[:6],
channel_ids=cids,
@@ -459,7 +458,7 @@ class TestHeavyMailPerformance(TransactionCase):
self.assertEqual(rec.message_channel_ids, self.channel)
# subscribe existing and new followers with force=True, meaning all will have the same subtypes
- with self.assertQueryCount(admin=8, emp=8): # test_mail only: 7 - 7
+ with self.assertQueryCount(__system__=8, emp=8): # test_mail only: 7 - 7
rec.message_subscribe(
partner_ids=pids,
channel_ids=cids,
@@ -470,7 +469,7 @@ class TestHeavyMailPerformance(TransactionCase):
self.assertEqual(rec.message_channel_ids, self.channel)
@mute_logger('odoo.tests', 'odoo.addons.mail.models.mail_mail', 'odoo.models.unlink')
- @users('admin', 'emp')
+ @users('__system__', 'emp')
@warmup
def test_complex_tracking_assignation(self):
""" Assignation performance test on already-created record """
@@ -482,7 +481,7 @@ class TestHeavyMailPerformance(TransactionCase):
})
self.assertEqual(rec.message_partner_ids, self.partners | self.env.user.partner_id)
- with self.assertQueryCount(admin=58, emp=77): # com runbot: 65 - 83 // test_mail only: 66 - 84
+ with self.assertQueryCount(__system__=58, emp=77): # com runbot: 65 - 83 // test_mail only: 66 - 84
rec.write({'user_id': self.user_portal.id})
self.assertEqual(rec.message_partner_ids, self.partners | self.env.user.partner_id | self.user_portal.partner_id)
@@ -497,7 +496,7 @@ class TestHeavyMailPerformance(TransactionCase):
self.assertEqual(rec.message_ids[2].needaction_partner_ids, self.env['res.partner'])
@mute_logger('odoo.tests', 'odoo.addons.mail.models.mail_mail', 'odoo.models.unlink')
- @users('admin', 'emp')
+ @users('__system__', 'emp')
@warmup
def test_complex_tracking_subscription_create(self):
""" Creation performance test involving auto subscription, assignation, tracking with subtype and template send. """
@@ -505,7 +504,7 @@ class TestHeavyMailPerformance(TransactionCase):
customer_id = self.customer.id
user_id = self.user_portal.id
- with self.assertQueryCount(admin=155, emp=190): # com runbot: 155 - 190 // test_mail only: 155 - 190
+ with self.assertQueryCount(__system__=155, emp=190): # com runbot: 155 - 190 // test_mail only: 155 - 190
rec = self.env['mail.test.full'].create({
'name': 'Test',
'umbrella_id': umbrella_id,
@@ -522,7 +521,7 @@ class TestHeavyMailPerformance(TransactionCase):
self.assertEqual(rec.message_ids[1].needaction_partner_ids, self.env['res.partner'])
@mute_logger('odoo.tests', 'odoo.addons.mail.models.mail_mail', 'odoo.models.unlink')
- @users('admin', 'emp')
+ @users('__system__', 'emp')
@warmup
def test_complex_tracking_subscription_subtype(self):
""" Write performance test involving auto subscription, tracking with subtype """
@@ -534,7 +533,7 @@ class TestHeavyMailPerformance(TransactionCase):
})
self.assertEqual(rec.message_partner_ids, self.user_portal.partner_id | self.env.user.partner_id)
- with self.assertQueryCount(admin=94, emp=111): # com runbot: 104 - 123 // test_mail only: 105 - 124
+ with self.assertQueryCount(__system__=94, emp=111): # com runbot: 104 - 123 // test_mail only: 105 - 124
rec.write({
'name': 'Test2',
'umbrella_id': self.umbrella.id,
@@ -552,7 +551,7 @@ class TestHeavyMailPerformance(TransactionCase):
self.assertEqual(rec.message_ids[2].needaction_partner_ids, self.env['res.partner'])
@mute_logger('odoo.tests', 'odoo.addons.mail.models.mail_mail', 'odoo.models.unlink')
- @users('admin', 'emp')
+ @users('__system__', 'emp')
@warmup
def test_complex_tracking_subscription_write(self):
""" Write performance test involving auto subscription, tracking with subtype and template send """
@@ -572,7 +571,7 @@ class TestHeavyMailPerformance(TransactionCase):
})
self.assertEqual(rec.message_partner_ids, self.user_portal.partner_id | self.env.user.partner_id)
- with self.assertQueryCount(admin=100, emp=122): # test_mail only: 111 - 134
+ with self.assertQueryCount(__system__=100, emp=122): # test_mail only: 111 - 134
rec.write({
'name': 'Test2',
'umbrella_id': umbrella_id,
@@ -591,7 +590,7 @@ class TestHeavyMailPerformance(TransactionCase):
self.assertEqual(rec.message_ids[2].needaction_partner_ids, self.env['res.partner'])
@mute_logger('odoo.tests', 'odoo.addons.mail.models.mail_mail', 'odoo.models.unlink')
- @users('admin', 'emp')
+ @users('__system__', 'emp')
@warmup
def test_complex_tracking_template(self):
""" Write performance test involving assignation, tracking with template """
@@ -606,7 +605,7 @@ class TestHeavyMailPerformance(TransactionCase):
})
self.assertEqual(rec.message_partner_ids, self.partners | self.env.user.partner_id | self.user_portal.partner_id)
- with self.assertQueryCount(admin=54, emp=76): # test_mail only: 54 - 75
+ with self.assertQueryCount(__system__=54, emp=76): # test_mail only: 54 - 75
rec.write({
'name': 'Test2',
'customer_id': customer_id,
diff --git a/addons/website/security/website_security.xml b/addons/website/security/website_security.xml
index 6702d0878f1..3be09426270 100644
--- a/addons/website/security/website_security.xml
+++ b/addons/website/security/website_security.xml
@@ -6,7 +6,7 @@