[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 <pimodoo@users.noreply.github.com>
This commit is contained in:
Joseph Caburnay
2020-08-17 14:08:29 +00:00
parent 4bd9ced6bf
commit 9cf8da90d5
@@ -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';