From 97517e8f0121afdb08ea801c99e6516fe010776c Mon Sep 17 00:00:00 2001 From: rhe-odoo Date: Fri, 8 Jul 2022 13:03:17 +0000 Subject: [PATCH] [FIX] pos_restaurant: allow refund with no table selected Before, when trying to do a refund from the floor plan, it was triggering an error. Now we check if a table was set on the order. If the order was set on the order, then we make the refund on the same table. If no table was set, then we take the first table available in the list. X-original-commit: 53e2f382a18a7eda6e15934d36dfbe350b6a2e32 Part-of: odoo/odoo#97157 --- addons/pos_restaurant/static/src/js/Screens/TicketScreen.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/addons/pos_restaurant/static/src/js/Screens/TicketScreen.js b/addons/pos_restaurant/static/src/js/Screens/TicketScreen.js index fe0ae6c0de0..4efe8cb8fb0 100644 --- a/addons/pos_restaurant/static/src/js/Screens/TicketScreen.js +++ b/addons/pos_restaurant/static/src/js/Screens/TicketScreen.js @@ -148,6 +148,12 @@ odoo.define('pos_restaurant.TicketScreen', function (require) { } return result; } + async _onDoRefund() { + if(this.env.pos.config.iface_floorplan) { + this.env.pos.set_table(this.getSelectedSyncedOrder().table ? this.getSelectedSyncedOrder().table : Object.values(this.env.pos.tables_by_id)[0]); + } + super._onDoRefund(); + } }; Registries.Component.extend(TicketScreen, PosResTicketScreen);