[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 <pim@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
This commit is contained in:
roen-odoo
2022-05-04 17:46:27 +02:00
parent a3473ae7d6
commit f48da4335b
@@ -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';
}
}
}