Files
odoo_source/addons/hr_timesheet/models/ir_ui_menu.py
T
bbh-odoo 2fb887225d [IMP] hr_timesheet: improved access rights
before this commit:
The approver can access all timesheets which is not coherent.

after this commit:
improved the labelling of the timesheet app's roles, modified the menu according
to role of User.Aprrover now can access his own timesheets only by click only
available option  'My timesheets'.

TaskID - 2531321

closes odoo/odoo#74242

Related: odoo/enterprise#19858
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-31 10:00:50 +00:00

15 lines
452 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
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_timesheet.group_hr_timesheet_approver'):
res.append(self.env.ref('hr_timesheet.timesheet_menu_activity_user').id)
return res