summaryrefslogtreecommitdiff
path: root/addons/test_mail/tests/test_performance.py
diff options
context:
space:
mode:
authorRobot Odoo <xmo+roboto@odoo.com>2018-12-12 18:35:02 +0100
committerGitHub <noreply@github.com>2018-12-12 18:35:02 +0100
commitff0c71f373864cf80b79da23e7386ad45b20cd4f (patch)
tree79a6c0d4352642dfeb9f6e478968f9d80f16fad2 /addons/test_mail/tests/test_performance.py
parent13eb9b9c5b77cb42616f91dc4db48e0a6aab014e (diff)
parentabc212f59a51d7b1de99201d5bb07c871021e766 (diff)
[MERGE][REF] mail: clean access right check on activities
This merge improves code of access rights checks when creating or updating activities. Several points triggers this commit * we would like to use _filter_access_rules and override it on activities model in order to be more standard; * we would like to get rid of sudo used in various CRUD overrides as using standard ORM method allows to correctly use current user; * we would like to get rid of create_user_id field once we can keep the current user as create_uid; Access rights are a bit updated. They are now the following * you can create activities for documents like posting messages (using _mail_post_access attribute; if not defined, write access on document is required); * you can read activities for documents you can read; * you can write and unlink activities either following the defined access rule (created OR assigned), and otherwise like posting messages ( using _mail_post_access attribute; if not defined, write access on document is required); In this merge we also hide edit / mark as done / cancel buttons for activities the current user cannot modify. Finally create_user_id field related to activities is replaced by create_uid everywhere. This commit is linked to task ID 1856417. closes odoo/odoo#27619
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 49befe45800..bb8b3437e84 100644
--- a/addons/test_mail/tests/test_performance.py
+++ b/addons/test_mail/tests/test_performance.py
@@ -172,7 +172,7 @@ class TestAdvMailPerformance(TransactionCase):
'default_res_model': 'mail.test.activity',
})
- with self.assertQueryCount(__system__=10, emp=15): # com runbot: 9 - 15 // test_mail only: 10 - 14
+ with self.assertQueryCount(__system__=10, emp=16): # com runbot: 9 - 15 // test_mail only: 10 - 14
activity = MailActivity.create({
'summary': 'Test Activity',
'res_id': record.id,
@@ -182,7 +182,7 @@ 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(__system__=26, emp=46): # com runbot: 25 - 46 // test_mail only: 26 - 46
+ with self.assertQueryCount(__system__=26, emp=50): # com runbot: 25 - 46 // test_mail only: 26 - 46
activity.action_feedback(feedback='Zizisse Done !')
@users('__system__', 'emp')
@@ -191,7 +191,7 @@ class TestAdvMailPerformance(TransactionCase):
def test_adv_activity_mixin(self):
record = self.env['mail.test.activity'].create({'name': 'Test'})
- with self.assertQueryCount(__system__=10, emp=15): # com runbot: 9 - 15 // test_mail only: 10 - 14
+ with self.assertQueryCount(__system__=10, emp=16): # com runbot: 9 - 15 // test_mail only: 10 - 14
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
@@ -199,7 +199,7 @@ class TestAdvMailPerformance(TransactionCase):
record.write({'name': 'Dupe write'})
- with self.assertQueryCount(__system__=28, emp=48): # com runbot: 27 - 86 // test_mail only: 28 - 48
+ with self.assertQueryCount(__system__=28, emp=52): # com runbot: 27 - 86 // test_mail only: 28 - 48
record.action_close('Dupe feedback')
self.assertEqual(record.activity_ids, self.env['mail.activity'])