From 0a77bc56e4c7cf243f086625a94d759a2bb917d6 Mon Sep 17 00:00:00 2001 From: Dossogne Bertrand Date: Mon, 14 Aug 2023 14:17:32 +0000 Subject: [PATCH] [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) Signed-off-by: Bertrand Dossogne (bedo) --- addons/hr_recruitment/models/hr_applicant.py | 3 ++- addons/hr_recruitment/views/hr_applicant_views.xml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/hr_recruitment/models/hr_applicant.py b/addons/hr_recruitment/models/hr_applicant.py index 9f280831801..9e26a9584aa 100644 --- a/addons/hr_recruitment/models/hr_applicant.py +++ b/addons/hr_recruitment/models/hr_applicant.py @@ -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) diff --git a/addons/hr_recruitment/views/hr_applicant_views.xml b/addons/hr_recruitment/views/hr_applicant_views.xml index 86cc9b72033..e52a367aaeb 100644 --- a/addons/hr_recruitment/views/hr_applicant_views.xml +++ b/addons/hr_recruitment/views/hr_applicant_views.xml @@ -136,6 +136,7 @@ + @@ -156,7 +157,6 @@ + -