[FIX] hr_recruitment: fix applicant form view access

Before this commit, all users with recruitment rights would have a
section of the applicant form hidden, though only those with interviewer
rights are supposed not to see it.
This commit brings back that section for both recruitment officers and admins.
The availability field has also been moved to keep it available for inteviewers.

closes odoo/odoo#132013

X-original-commit: 23c6df4683bf00578648b6af56f61d3ab01e8d20
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
Signed-off-by: Bertrand Dossogne (bedo) <bedo@odoo.com>
This commit is contained in:
Dossogne Bertrand
2023-08-17 18:43:12 +02:00
parent ab10ed0c62
commit 0a77bc56e4
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -355,7 +355,8 @@ class Applicant(models.Model):
@api.model
def get_view(self, view_id=None, view_type='form', **options):
if view_type == 'form' and self.user_has_groups('hr_recruitment.group_hr_recruitment_interviewer'):
if view_type == 'form' and self.user_has_groups('hr_recruitment.group_hr_recruitment_interviewer')\
and not self.user_has_groups('hr_recruitment.group_hr_recruitment_user'):
view_id = self.env.ref('hr_recruitment.hr_applicant_view_form_interviewer').id
return super().get_view(view_id, view_type, **options)
@@ -136,6 +136,7 @@
<field name="priority" widget="priority"/>
<field name="source_id"/>
<field name="medium_id"/>
<field name="availability"/>
<field name="categ_ids" placeholder="Tags" widget="many2many_tags" options="{'color_field': 'color', 'no_create_edit': True}"/>
</group>
<group string="Job">
@@ -156,7 +157,6 @@
<span attrs="{'invisible':[('salary_proposed_extra','=',False)]}"> + </span>
<field name="salary_proposed_extra" placeholder="Extra advantages..."/>
</div>
<field name="availability"/>
</group>
</group>
<notebook>