mirror of
https://github.com/bringout/oca-ocb-hr.git
synced 2026-04-24 00:52:01 +02:00
19.0 vanilla
This commit is contained in:
parent
a1137a1456
commit
e1d89e11e3
2789 changed files with 1093187 additions and 605897 deletions
|
|
@ -1,7 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import models, api, tools
|
||||
from odoo import models
|
||||
|
||||
|
||||
class IrUiMenu(models.Model):
|
||||
|
|
@ -9,7 +8,12 @@ class IrUiMenu(models.Model):
|
|||
|
||||
def _load_menus_blacklist(self):
|
||||
res = super()._load_menus_blacklist()
|
||||
emp_menu = self.env.ref('hr.menu_hr_employee', raise_if_not_found=False)
|
||||
if emp_menu and self.env.user.has_group('hr.group_hr_user'):
|
||||
if self.env.user.has_group('hr.group_hr_user') and (emp_menu := self.env.ref('hr.menu_hr_employee', raise_if_not_found=False)):
|
||||
res.append(emp_menu.id)
|
||||
else:
|
||||
is_department_manager = bool(self.env["hr.department"].search_count([
|
||||
('manager_id', 'in', self.env.user.employee_ids.ids)
|
||||
], limit=1))
|
||||
if not is_department_manager and (dep_menu := self.env.ref('hr.menu_hr_department_kanban', raise_if_not_found=False)):
|
||||
res.append(dep_menu.id)
|
||||
return res
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue