addons/hr_timesheet_attendance/models/ir_ui_menu.py
raw| 1 | # Part of Odoo. See LICENSE file for full copyright and licensing details. |
| 2 | |
| 3 | from odoo import models |
| 4 | |
| 5 | |
| 6 | class IrUiMenu(models.Model): |
| 7 | _inherit = 'ir.ui.menu' |
| 8 | |
| 9 | def _load_menus_blacklist(self): |
| 10 | res = super()._load_menus_blacklist() |
| 11 | if not self.env.user.has_group('hr_timesheet.group_hr_timesheet_user') and (att_menu := self.env.ref('hr_timesheet_attendance.menu_hr_timesheet_attendance_report', raise_if_not_found=False)): |
| 12 | res.append(att_menu.id) |
| 13 | return res |