跳至内容
菜单
此问题已终结
2 回复
3313 查看

Reporting Manager can approving their leaves. How to restrict this option. Reporting Manager should approve/reject his team’s leave but his leave should only be approved/rejected by his Reporting Manager. We have multi level Hierarchy. We are using 11 version.

形象
丢弃

Which version of Odoo are you using? This was addressed at v12. See https://github.com/odoo/odoo/pull/19270/files

编写者

Hi Niyas, Where I have to put this code exactly, Could you please elaborate, I new to the odoo.

最佳答案

Hi,

There are some modules available in the store for preventing the same, but they seems to be paid. If you are ready you can check it out. Otherwise you can enable the double approval for the leaves and restrict this criteria.

Other option is to do some custom code and override the action of the approval button and compare the logged in user and check the requesting user and raise warning if both are same.


Python code:

class HRLeave(models.Model):
_inherit = 'hr.leave'

@api.multi
def action_approve(self):
res = super(HRLeave,self).action_approve()
# do the coding here to check the user and requested employee and raise warning
return res


Thanks

形象
丢弃
相关帖文 回复 查看 活动
1
2月 20
2606
2
2月 22
4667
1
11月 19
3750
3
6月 18
10045
1
6月 16
8543