From 9cf8da90d5ba1ed4ee924659dea1bd4313dcc3c6 Mon Sep 17 00:00:00 2001 From: Joseph Caburnay Date: Mon, 17 Aug 2020 14:02:34 +0000 Subject: [PATCH] [FIX] pos_restaurant: should show product screen after tip screen If floor screen (iface_floorplan) is not active in the pos.config, product screen should follow the tip screen and not an error. closes odoo/odoo#55998 Signed-off-by: pimodoo --- .../pos_restaurant/static/src/js/Screens/TipScreen.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/addons/pos_restaurant/static/src/js/Screens/TipScreen.js b/addons/pos_restaurant/static/src/js/Screens/TipScreen.js index efbd83ea007..64500395cd1 100644 --- a/addons/pos_restaurant/static/src/js/Screens/TipScreen.js +++ b/addons/pos_restaurant/static/src/js/Screens/TipScreen.js @@ -66,10 +66,16 @@ odoo.define('pos_restaurant.TipScreen', function (require) { } goNextScreen() { this.env.pos.get_order().finalize(); - this.showScreen(this.nextScreen); + const { name, props } = this.nextScreen; + this.showScreen(name, props); } get nextScreen() { - return 'FloorScreen'; + if (this.env.pos.config.module_pos_restaurant && this.env.pos.config.iface_floorplan) { + const table = this.env.pos.table; + return { name: 'FloorScreen', props: { floor: table ? table.floor : null } }; + } else { + return { name: 'ProductScreen' }; + } } } TipScreen.template = 'pos_restaurant.TipScreen';