Skip to content
Snippets Groups Projects
Commit e7ebb669 authored by alt-odoo's avatar alt-odoo
Browse files

[FIX] website_hr_recruitment: allow portal users to filter by department


Currently, only a public user or an internal user can access HR
department information. This is causing an access rights error when
trying to filter job offers on the website if connected with a portal
user, while there is no error if not connected (public user). We should
have the same behavior for the two cases.

closes odoo/odoo#92003

X-original-commit: 689a3aa9
Signed-off-by: default avatarRomain Derie (rde) <rde@odoo.com>
Signed-off-by: default avatarAlex Thuyls (alt) <alt@odoo.com>
parent aa468fe0
No related branches found
No related tags found
No related merge requests found
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import hr_department
from . import hr_recruitment
from . import website
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class Department(models.Model):
_inherit = 'hr.department'
def name_get(self):
# Get department name using superuser, because model is not accessible
# for portal users
self_sudo = self.sudo()
return super(Department, self_sudo).name_get()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment