From 7bd2327d79d578c8ee2afb119e1bb08efc3d860f Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Tue, 13 Jun 2023 14:13:30 +0200 Subject: [PATCH] [IMP] hr_recruitment: Remove restrictive and confusing ir.rule No need to hide the chatter to recruiters, as the salary configurator has been improved to avoid posting sensitive data on the application form itself. TaskID: 3101400 --- .../security/hr_recruitment_security.xml | 16 ---------- .../tests/test_recruitment_interviewer.py | 30 ++----------------- 2 files changed, 3 insertions(+), 43 deletions(-) diff --git a/addons/hr_recruitment/security/hr_recruitment_security.xml b/addons/hr_recruitment/security/hr_recruitment_security.xml index 2b337c5e3d5..29a16ef8f3e 100644 --- a/addons/hr_recruitment/security/hr_recruitment_security.xml +++ b/addons/hr_recruitment/security/hr_recruitment_security.xml @@ -73,22 +73,6 @@ - - Interviewer: No Applicant Chatter - - [ - '|', - ('model', '!=', 'hr.applicant'), - '&', - ('model', '=', 'hr.applicant'), - ('mail_activity_type_id', '!=', False) - ] - - - - - - User: All Chatter diff --git a/addons/hr_recruitment/tests/test_recruitment_interviewer.py b/addons/hr_recruitment/tests/test_recruitment_interviewer.py index eeab5a9d3a3..e624063d9f1 100644 --- a/addons/hr_recruitment/tests/test_recruitment_interviewer.py +++ b/addons/hr_recruitment/tests/test_recruitment_interviewer.py @@ -5,7 +5,10 @@ from odoo.exceptions import AccessError from odoo.tests.common import new_test_user from odoo.addons.mail.tests.common import MailCommon +from odoo.tests import tagged + +@tagged('recruitment_interviewer') class TestRecruitmentInterviewer(MailCommon): @classmethod def setUpClass(cls): @@ -98,30 +101,3 @@ class TestRecruitmentInterviewer(MailCommon): with self.assertRaises(AccessError): applicant.with_user(self.interviewer_user).create_employee_from_applicant() - - def test_interviewer_chatter(self): - self.manager_user.notification_type = 'email' - self.interviewer_user.notification_type = 'email' - applicant = self.env['hr.applicant'].create({ - 'name': 'toto', - 'partner_name': 'toto', - 'job_id': self.job.id, - 'interviewer_ids': self.interviewer_user.ids, - }) - - applicant.message_subscribe(partner_ids=[self.interviewer_user.partner_id.id]) - - with self.mock_mail_gateway(): - message = applicant.message_post(body='A super secret message', message_type='comment', subtype_xmlid='mail.mt_comment') - - with self.assertRaises(AccessError): - message.with_user(self.interviewer_user).read() - - try: - self._find_mail_mail_wpartners(self.interviewer_user.partner_id, None) - except AssertionError: - pass - else: - raise AssertionError('No mail.mail should be sent to members of Interviewer group') - - self.assertSentEmail(self.env.user.partner_id, [self.manager_user.partner_id])