From c8e83a894a9ad09ec9efcc90b985d743b99cff23 Mon Sep 17 00:00:00 2001 From: "Theo VINCENT (thvi)" Date: Thu, 17 Aug 2023 07:51:46 +0000 Subject: [PATCH] [FIX] point_of_sale: closing session without cash The closing session popup input for bank payment methods throws an error when no cash payment method is configured. Steps to reproduce: - Configure a shop without any cash payment method and with at least one bank payment method - Open a session for that shop - Click on the button to display the closing session popup - In the popup, change the amount of the bank payment method An error is thrown. The fix simply consists in correctly checking if there is a cash payment method. closes odoo/odoo#132243 Task-id: 3468828 X-original-commit: 554ccb12a154f30f03c01931dc66eb04394f8154 Signed-off-by: Joseph Caburnay (jcb) --- .../static/src/app/navbar/closing_popup/closing_popup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/static/src/app/navbar/closing_popup/closing_popup.js b/addons/point_of_sale/static/src/app/navbar/closing_popup/closing_popup.js index ce44bd997d1..9c4495ac81e 100644 --- a/addons/point_of_sale/static/src/app/navbar/closing_popup/closing_popup.js +++ b/addons/point_of_sale/static/src/app/navbar/closing_popup/closing_popup.js @@ -110,7 +110,7 @@ export class ClosePosPopup extends AbstractAwaitablePopup { handleInputChange(paymentId, event) { if (event.target.classList.contains('invalid-cash-input')) return; let expectedAmount; - if (paymentId === this.defaultCashDetails.id) { + if (paymentId === this.defaultCashDetails?.id) { this.manualInputCashCount = true; this.moneyDetails = null; this.state.notes = "";