From f48da4335bc1136fa14c05a0a016862f07bc0dff Mon Sep 17 00:00:00 2001 From: roen-odoo Date: Thu, 28 Apr 2022 10:17:08 +0000 Subject: [PATCH] [FIX] point_of_sale: prevent multiple click on print invoice Current behavior: When clicking multiple times on the print invoice button of an order the customer rank would not update correctly Steps to reproduce: - Have PoS installed - Start a PoS session, and select customer A - Create an order, make the payment - Go in the order tab and select the order you just made - Click on the Print invoice button multiple times - Customer rank isn't updated correctly opw-2813512 closes odoo/odoo#90515 X-original-commit: 695c3dfd46d4e421a06f6dd33861e42bdb03efe0 Signed-off-by: Masereel Pierre Signed-off-by: Engels Robin (roen) --- .../js/Screens/TicketScreen/ControlButtons/InvoiceButton.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/point_of_sale/static/src/js/Screens/TicketScreen/ControlButtons/InvoiceButton.js b/addons/point_of_sale/static/src/js/Screens/TicketScreen/ControlButtons/InvoiceButton.js index 89e7860006a..3883718bd86 100644 --- a/addons/point_of_sale/static/src/js/Screens/TicketScreen/ControlButtons/InvoiceButton.js +++ b/addons/point_of_sale/static/src/js/Screens/TicketScreen/ControlButtons/InvoiceButton.js @@ -117,6 +117,7 @@ odoo.define('point_of_sale.InvoiceButton', function (require) { } async _onClick() { try { + this.el.style.pointerEvents = 'none'; await this._invoiceOrder(); } catch (error) { if (isConnectionError(error)) { @@ -127,6 +128,8 @@ odoo.define('point_of_sale.InvoiceButton', function (require) { } else { throw error; } + } finally { + this.el.style.pointerEvents = 'auto'; } } }