Browse Source

MAY 12: [FIX] Bug Fixed 'auto_logout_idle_user_odoo'

pull/346/merge
Cybrosys Technologies 2 months ago
parent
commit
46e58407da
  1. 2
      auto_logout_idle_user_odoo/__manifest__.py
  2. 5
      auto_logout_idle_user_odoo/doc/RELEASE_NOTES.md
  3. 11
      auto_logout_idle_user_odoo/static/src/js/systray.js
  4. 2
      auto_logout_idle_user_odoo/static/src/xml/systray.xml

2
auto_logout_idle_user_odoo/__manifest__.py

@ -21,7 +21,7 @@
#############################################################################
{
'name': 'Logout Idle User',
'version': '18.0.1.0.0',
'version': '18.0.1.0.1',
'category': 'Extra Tools',
'summary': """Auto logout idle user with fixed time""",
'description': """User can fix the timer in the user's profile, if the user

5
auto_logout_idle_user_odoo/doc/RELEASE_NOTES.md

@ -4,3 +4,8 @@
#### Version 18.0.1.0.0
##### ADD
- Initial Commit for Logout Idle User
#### 05.05.2025
#### Version 17.0.1.0.1
#### UPDT
- Fixed an issue that occurred while loading the website.

11
auto_logout_idle_user_odoo/static/src/js/systray.js

@ -11,6 +11,9 @@ class TimerSystrayItem extends Component{
setup(){
super.setup();
this.get_idle_time();
this.state = useState({
idle_time: null,
})
}
get_idle_time() {
var self = this
@ -41,16 +44,16 @@ class TimerSystrayItem extends Component{
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
if (hours && days) {
document.querySelector("#idle_timer").innerHTML = days + "d " + hours + "h " + minutes + "m " + seconds + "s ";
self.state.idle_time = days + "d " + hours + "h " + minutes + "m " + seconds + "s ";
} else if (hours) {
document.querySelector("#idle_timer").innerHTML = hours + "h " + minutes + "m " + seconds + "s ";
self.state.idle_time = hours + "h " + minutes + "m " + seconds + "s ";
} else {
document.querySelector("#idle_timer").innerHTML = minutes + "m " + seconds + "s ";
self.state.idle_time = minutes + "m " + seconds + "s ";
}
/** if the countdown is zero the link is redirect to the login page*/
if (distance < 0) {
clearInterval(idle);
document.querySelector("#idle_timer").innerHTML = "EXPIRED";
self.state.idle_time = "EXPIRED";
location.replace("/web/session/logout")
}
}, 1000);

2
auto_logout_idle_user_odoo/static/src/xml/systray.xml

@ -5,7 +5,7 @@
<div class="new_icon pt-2">
<div id="div-timer">
<i class="fa fa-clock-o systray-icon" />
<p id="idle_timer"/>
<p t-esc="this.state.idle_time"/>
</div>
</div>
</t>

Loading…
Cancel
Save