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>
15 lines
452 B
Python
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
|