Skip to content
Snippets Groups Projects
Commit 6e1b660f authored by LofbergValentin's avatar LofbergValentin Committed by Yannick Tivisse
Browse files

[FIX] hr_attendance: Keep the kiosk session alive

closes #1800442

Purpose
=======

Odoo sessions are expired when no action has been triggered
for the last 7 days. For kiosk mode, this doesn’t make sense.

It means that once a week, a person with the rights to the
employee under kiosk mode, has to come to the screen and log in again.

Specification
=============

Trigger an action to keep the Odoo session alive.
parent 299b613d
No related branches found
No related tags found
No related merge requests found
......@@ -36,6 +36,8 @@ var KioskMode = Widget.extend(BarcodeHandlerMixin, {
self.$el.html(QWeb.render("HrAttendanceKioskMode", {widget: self}));
self.start_clock();
});
// Make a RPC call every day to keep the session alive
self._interval = window.setInterval(this._callServer.bind(this), (60*60*1000*24));
return self._super.apply(this, arguments);
},
......@@ -60,8 +62,15 @@ var KioskMode = Widget.extend(BarcodeHandlerMixin, {
destroy: function () {
clearInterval(this.clock_start);
clearInterval(this._interval);
this._super.apply(this, arguments);
},
_callServer: function () {
// Make a call to the database to avoid the auto close of the session
return Session.rpc('/web/webclient/version_info', {})
},
});
core.action_registry.add('hr_attendance_kiosk_mode', KioskMode);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment