[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
This commit is contained in:
Yannick Tivisse
2023-07-05 14:21:28 +02:00
parent 71b9933411
commit 7bd2327d79
2 changed files with 3 additions and 43 deletions
@@ -73,22 +73,6 @@
<field name="groups" eval="[(4, ref('hr_recruitment.group_hr_recruitment_user'))]"/>
</record>
<record id="mail_message_interviewer_rule" model="ir.rule">
<field name="name">Interviewer: No Applicant Chatter</field>
<field name="model_id" ref="mail.model_mail_message"/>
<field name="domain_force">[
'|',
('model', '!=', 'hr.applicant'),
'&amp;',
('model', '=', 'hr.applicant'),
('mail_activity_type_id', '!=', False)
]</field>
<field name="perm_write" eval="False"/>
<field name="perm_create" eval="False"/>
<field name="perm_unlink" eval="False"/>
<field name="groups" eval="[(4, ref('hr_recruitment.group_hr_recruitment_interviewer'))]"/>
</record>
<record id="mail_message_user_rule" model="ir.rule">
<field name="name">User: All Chatter</field>
<field name="model_id" ref="mail.model_mail_message"/>
@@ -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])