From 5f4dd71656bca121a5e37038831bda6ab5cb93d8 Mon Sep 17 00:00:00 2001 From: roen-odoo Date: Tue, 26 Apr 2022 13:20:31 +0000 Subject: [PATCH] [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 --- addons/point_of_sale/static/src/js/Chrome.js | 3 +++ addons/pos_hr/static/src/js/Chrome.js | 3 +++ addons/pos_restaurant/static/src/js/Chrome.js | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/js/Chrome.js b/addons/point_of_sale/static/src/js/Chrome.js index 7ebe3857406..872e75a86b3 100644 --- a/addons/point_of_sale/static/src/js/Chrome.js +++ b/addons/point_of_sale/static/src/js/Chrome.js @@ -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", { diff --git a/addons/pos_hr/static/src/js/Chrome.js b/addons/pos_hr/static/src/js/Chrome.js index 5109feab282..181e7848cb8 100644 --- a/addons/pos_hr/static/src/js/Chrome.js +++ b/addons/pos_hr/static/src/js/Chrome.js @@ -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); diff --git a/addons/pos_restaurant/static/src/js/Chrome.js b/addons/pos_restaurant/static/src/js/Chrome.js index be20fb1d9b7..58141ec9a70 100644 --- a/addons/pos_restaurant/static/src/js/Chrome.js +++ b/addons/pos_restaurant/static/src/js/Chrome.js @@ -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);