Skip to content
Snippets Groups Projects
Commit 5cab5c11 authored by Yannick Tivisse's avatar Yannick Tivisse
Browse files

[FIX] pos_hr: Allow HR officer to unlink an employee


closes odoo/odoo#84509

Related: odoo/enterprise#24302
Signed-off-by: default avatarYannick Tivisse (yti) <yti@odoo.com>
parent fa2cc58e
Branches
Tags
No related merge requests found
......@@ -24,7 +24,7 @@ class HrEmployee(models.Model):
@api.ondelete(at_uninstall=False)
def _unlink_except_active_pos_session(self):
configs_with_employees = self.env['pos.config'].search([('module_pos_hr', '=', 'True')]).filtered(lambda c: c.current_session_id)
configs_with_employees = self.env['pos.config'].sudo().search([('module_pos_hr', '=', 'True')]).filtered(lambda c: c.current_session_id)
configs_with_all_employees = configs_with_employees.filtered(lambda c: not c.employee_ids)
configs_with_specific_employees = configs_with_employees.filtered(lambda c: c.employee_ids & self)
if configs_with_all_employees or configs_with_specific_employees:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment