Files
odoo_source/addons/hr/models/ir_ui_menu.py
T
sofiagvaladze d713b445c7 [IMP] hr: Hide menu_hr_employee for group_hr_user
Reason: In Employees app, it is confusing for the first time users to see
both 'Employees' and 'Employee Directory' folder. Also, first user
is not assigned to any departments.

Solution: If the user can see the folder 'Employees', don't show
the folder 'Employee Directory'. Assign the first user to the
'Administration' department.

Task - 2377506

closes odoo/odoo#63038

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-12-15 09:21:05 +00:00

15 lines
418 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, api, tools
class IrUiMenu(models.Model):
_inherit = 'ir.ui.menu'
def _load_menus_blacklist(self):
res = super()._load_menus_blacklist()
if self.env.user.has_group('hr.group_hr_user'):
res.append(self.env.ref('hr.menu_hr_employee').id)
return res