[FIX] hr_attendance: use correct reference for kioskDelay

A traceback would occur in some situations because of incorrect
reference to `this.kioskDelay`.

closes odoo/odoo#103753

X-original-commit: 5069c8fd1cee063827873de0f6c2d9fe938337a9
Signed-off-by: Kevin Baptiste <kba@odoo.com>
This commit is contained in:
Kevin Baptiste
2022-10-21 14:06:22 +02:00
parent 5f00654491
commit e2232c8909
@@ -164,6 +164,7 @@ var GreetingMessage = AbstractAction.extend({
clearTimeout(this.return_to_main_menu);
}
core.bus.off('barcode_scanned', this, this._onBarcodeScanned);
const kioskDelay = this.kioskDelay;
this._rpc({
model: 'hr.employee',
method: 'attendance_scan',
@@ -174,13 +175,13 @@ var GreetingMessage = AbstractAction.extend({
self.do_action(result.action);
} else if (result.warning) {
self.displayNotification({ title: result.warning, type: 'danger' });
if (this.kioskDelay > 0) {
setTimeout( function() { self.do_action(self.next_action, {clear_breadcrumbs: true}); }, this.kioskDelay);
if (kioskDelay > 0) {
setTimeout( function() { self.do_action(self.next_action, {clear_breadcrumbs: true}); }, kioskDelay);
}
}
}, function () {
if (this.kioskDelay > 0) {
setTimeout( function() { self.do_action(self.next_action, {clear_breadcrumbs: true}); }, this.kioskDelay);
if (kioskDelay > 0) {
setTimeout( function() { self.do_action(self.next_action, {clear_breadcrumbs: true}); }, kioskDelay);
}
});
}