From 08b3862a828fbdcdc1aa819ced4c7ec1ce7523c3 Mon Sep 17 00:00:00 2001 From: rhe-odoo Date: Fri, 29 Jul 2022 14:44:01 +0000 Subject: [PATCH] [FIX] pos_restaurant: delete table from ticket screen When a table was deleted and the ticket screen was already loaded once with orders, if a table was deleted, the ticket screen cache would keep the tables recorded on the order. Now, when a table is deleted, the ticketScreen cache is reseted. This fix also delete the table from the list of the model. closes odoo/odoo#97157 X-original-commit: 134c3228e02b3fbabdb411de872ff717a26a832e Signed-off-by: Masereel Pierre --- .../static/src/js/Screens/FloorScreen/FloorScreen.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/pos_restaurant/static/src/js/Screens/FloorScreen/FloorScreen.js b/addons/pos_restaurant/static/src/js/Screens/FloorScreen/FloorScreen.js index 3a0b17548d9..6b45d75c0f4 100644 --- a/addons/pos_restaurant/static/src/js/Screens/FloorScreen/FloorScreen.js +++ b/addons/pos_restaurant/static/src/js/Screens/FloorScreen/FloorScreen.js @@ -336,6 +336,8 @@ odoo.define('pos_restaurant.FloorScreen', function (require) { if (this.state.selectedTableId === originalSelectedTableId) { this.state.selectedTableId = null; } + delete this.env.pos.tables_by_id[originalSelectedTableId]; + this.env.pos.TICKET_SCREEN_STATE.syncedOrders.cache = {}; } catch (error) { if (isConnectionError(error)) { await this.showPopup('OfflineErrorPopup', {