[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 <pim@odoo.com>
This commit is contained in:
Eleftherios Kritsotakis
2022-07-08 18:45:03 +02:00
parent 7b03c59353
commit 7a5120e703
@@ -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);