Skip to content
Snippets Groups Projects
Commit e2991ff6 authored by Pierrot (prro)'s avatar Pierrot (prro)
Browse files

[FIX] hr: mark offline employee status


How to reproduce the problem:
- Install the Employees app
- Create a new user and create an employee form for this user
- Log in with this user, then log out
- On the user's Employees form, the employee still appears as connected

Cause of the problem : as soon as a user logs in,
the system saves the date of his last connection. That value was wrongly
used in the process of computing the user's status.

Now, if the user is offline, he is shown as "Not Available" or "Away"
(grey or orange).

opw-2623386

closes odoo/odoo#77488

Signed-off-by: default avatarKevin Baptiste <kba@odoo.com>
parent bb16d3e9
Branches
Tags
No related merge requests found
......@@ -67,7 +67,7 @@ class HrEmployeeBase(models.AbstractModel):
for employee in self:
state = 'to_define'
if check_login:
if employee.user_id.im_status == 'online' or employee.last_activity:
if employee.user_id.im_status == 'online':
state = 'present'
elif employee.user_id.im_status == 'offline' and employee.id not in working_now_list:
state = 'absent'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment