Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
652 มุมมอง

I've created a dashboard item that's supposed to show the number of currently logged-in users. Here's the code I'm using to retrieve this information:

online_users = self.env['res.users'].search_count([('im_status', '=', 'online')])

However, the number returned is surprisingly high. It seems that once a user has logged in, they remain marked as "online".

What's the correct way to get the actual number of currently logged-in users? I'm using Odoo Community 18.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Users are only logged into Odoo for the brief time it takes for the Odoo Server to process their request, they are then "logged out".


อวตาร
ละทิ้ง
ผู้เขียน

Ray, it seems that after waiting fot one week there are still 5 users logged in. It doesn't change whether I restart Odoo or what I do.. I'm the only developer and user, so that cannot be correct. There must be users I've created and logged in like a month ago.

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
พ.ค. 25
618
1
พ.ค. 25
779
1
เม.ย. 25
1208
Odoo docs Chapter 12: Inheritance แก้ไขแล้ว
1
พ.ค. 25
790
2
เม.ย. 25
1206