[FIX] pos_hr: keep login screen open in idle

Current behavior:
When authorized employees is activated is activated for a PoS if you
go back to the login screen and do nothing for like 1 minutes you would
go back to the PoS logged as the previous employee

Steps to reproduce:
- Have PoS installed, create a PoS restaurant wiht authorized employee
- Start a PoS session
- Click on the lock button to go back to the login screen
- Wait for 1 minute
- The screen go back to the PoS

opw-2792531

closes odoo/odoo#90698

X-original-commit: e1741d904f5ae206dff767ff215e0568a7ef008e
Signed-off-by: Masereel Pierre <pim@odoo.com>
This commit is contained in:
roen-odoo
2022-05-06 12:27:52 +02:00
committed by Pierre Masereel
parent 3c14a3810e
commit 5f4dd71656
3 changed files with 7 additions and 1 deletions
@@ -545,6 +545,9 @@ odoo.define('point_of_sale.Chrome', function(require) {
console.error('Unknown error. Unable to show information about this error.', errorToHandle);
}
}
_shouldResetIdleTimer() {
return true;
}
}
Chrome.template = 'Chrome';
Object.defineProperty(Chrome, "components", {
+3
View File
@@ -22,6 +22,9 @@ odoo.define('pos_hr.chrome', function (require) {
}
return super.shouldShowCashControl();
}
_shouldResetIdleTimer() {
return super._shouldResetIdleTimer() && this.tempScreen.name !== 'LoginScreen';
}
};
Registries.Component.extend(Chrome, PosHrChrome);
@@ -60,7 +60,7 @@ odoo.define('pos_restaurant.chrome', function (require) {
this.showScreen('FloorScreen', { floor: table ? table.floor : null });
}
_shouldResetIdleTimer() {
return this.env.pos.config.iface_floorplan && this.mainScreen.name !== 'FloorScreen';
return super._shouldResetIdleTimer() && this.env.pos.config.iface_floorplan && this.mainScreen.name !== 'FloorScreen';
}
__showScreen() {
super.__showScreen(...arguments);