diff --git a/auto_logout_idle_user_odoo/__manifest__.py b/auto_logout_idle_user_odoo/__manifest__.py index b5af1136f..9bec2bd0a 100644 --- a/auto_logout_idle_user_odoo/__manifest__.py +++ b/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 diff --git a/auto_logout_idle_user_odoo/doc/RELEASE_NOTES.md b/auto_logout_idle_user_odoo/doc/RELEASE_NOTES.md index 6936b70d5..60d8b1b12 100644 --- a/auto_logout_idle_user_odoo/doc/RELEASE_NOTES.md +++ b/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. diff --git a/auto_logout_idle_user_odoo/static/src/js/systray.js b/auto_logout_idle_user_odoo/static/src/js/systray.js index 044a6ff6d..ee9bc4201 100644 --- a/auto_logout_idle_user_odoo/static/src/js/systray.js +++ b/auto_logout_idle_user_odoo/static/src/js/systray.js @@ -1,5 +1,5 @@ /* @odoo-module */ -import { Component,useState } from "@odoo/owl"; +import { Component, useState } from "@odoo/owl"; import { rpc } from "@web/core/network/rpc"; import { registry } from "@web/core/registry"; import { session } from "@web/session"; @@ -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); diff --git a/auto_logout_idle_user_odoo/static/src/xml/systray.xml b/auto_logout_idle_user_odoo/static/src/xml/systray.xml index 470d75dbd..b756a70b1 100644 --- a/auto_logout_idle_user_odoo/static/src/xml/systray.xml +++ b/auto_logout_idle_user_odoo/static/src/xml/systray.xml @@ -5,7 +5,7 @@
-

+