From 7a5120e703b656db75fc36812dd73367535d5afa Mon Sep 17 00:00:00 2001 From: Eleftherios Kritsotakis Date: Tue, 5 Jul 2022 10:58:29 +0000 Subject: [PATCH] [FIX] pos_restaurant: PaymentScreen closes while paying Before this commit, if a user were inside the PaymentScreen and stayed idle for more than 1 min, the system would take them back to the FloorScreen, even if they were in the middle of a payment proccess. This would interrupt their workflow and cause a negative userexperience. For this reason, if a user has added payments (which means that they are in the middle of a payment workflow) the screen will not switch back to the FloorScreen. opw-2849939 closes odoo/odoo#95447 X-original-commit: 755e90019c6a7530c9026842dedeb9765969ad1f Signed-off-by: Masereel Pierre --- addons/pos_restaurant/static/src/js/Chrome.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/pos_restaurant/static/src/js/Chrome.js b/addons/pos_restaurant/static/src/js/Chrome.js index fdfc05941e9..aadcc111b6a 100644 --- a/addons/pos_restaurant/static/src/js/Chrome.js +++ b/addons/pos_restaurant/static/src/js/Chrome.js @@ -66,7 +66,8 @@ 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'; + const stayPaymentScreen = this.mainScreen.name === 'PaymentScreen' && this.env.pos.get_order().paymentlines.length > 0; + return this.env.pos.config.iface_floorplan && !stayPaymentScreen && this.mainScreen.name !== 'FloorScreen'; } __showScreen() { super.__showScreen(...arguments);