diff options
Diffstat (limited to 'addons/test_mail/tests/test_message_track.py')
| -rw-r--r-- | addons/test_mail/tests/test_message_track.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/addons/test_mail/tests/test_message_track.py b/addons/test_mail/tests/test_message_track.py index 3050951f45f..df024c1e094 100644 --- a/addons/test_mail/tests/test_message_track.py +++ b/addons/test_mail/tests/test_message_track.py @@ -5,6 +5,7 @@ from unittest.mock import patch from odoo.addons.test_mail.tests.common import TestMailCommon from odoo.tests.common import tagged +from odoo.tests import Form @tagged('mail_track') @@ -313,6 +314,17 @@ class TestTrackingInternals(TestMailCommon): self.assertFalse(msg_emp.get('tracking_values'), "should not have protected tracking values") self.assertTrue(msg_sudo.get('tracking_values'), "should have protected tracking values") + # test editing the record with user not in the group of the field + self.record.invalidate_cache() + self.record.clear_caches() + record_form = Form(self.record.with_user(self.user_employee)) + record_form.name = 'TestDoNoCrash' + # the employee user must be able to save the fields on which he can write + # if we fetch all the tracked fields, ignoring the group of the current user + # it will crash and it shouldn't + record = record_form.save() + self.assertEqual(record.name, 'TestDoNoCrash') + def test_track_sequence(self): """ Update some tracked fields and check that the mail.tracking.value are ordered according to their tracking_sequence""" self.record.write({ |
