From 6cc1c435fd3bb9ed71c4a02796099c6e6f6b5d2b Mon Sep 17 00:00:00 2001 From: roen-odoo Date: Thu, 7 Sep 2023 13:32:12 +0000 Subject: [PATCH] =?UTF-8?q?[FIX]=20point=5Fof=5Fsale:=20remove=200?= =?UTF-8?q?=E2=82=AC=20payment=20line=20of=20orders?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Current behavior: When an order contains a payment line with 0€, and a customer account payment line. Then you close the PoS and invoice the order from an other PoS session, you get an error. Steps to reproduce: - Open PoS, make a new order with a payment line of 0€ and a customer account payment line. - Close the session and open a new one. - Go in the paid order, and try to invoice it. - You get an error. Fix: To fix the issue we just remove the useless 0€ payment line. opw-3477486 closes odoo/odoo#135284 X-original-commit: 24c311670164d5f06dc50d829bb653b06cf86f07 Signed-off-by: Joseph Caburnay (jcb) Signed-off-by: Robin Engels (roen) --- _d | 0 .../static/src/app/screens/payment_screen/payment_screen.js | 5 +++++ 2 files changed, 5 insertions(+) create mode 100644 _d diff --git a/_d b/_d new file mode 100644 index 00000000000..e69de29bb2d diff --git a/addons/point_of_sale/static/src/app/screens/payment_screen/payment_screen.js b/addons/point_of_sale/static/src/app/screens/payment_screen/payment_screen.js index 45d5982839b..002048b3abc 100644 --- a/addons/point_of_sale/static/src/app/screens/payment_screen/payment_screen.js +++ b/addons/point_of_sale/static/src/app/screens/payment_screen/payment_screen.js @@ -256,6 +256,11 @@ export class PaymentScreen extends Component { } this.currentOrder.date_order = luxon.DateTime.now(); + for (let line of this.paymentLines) { + if (!line.amount === 0) { + this.currentOrder.remove_paymentline(line); + } + } this.currentOrder.finalized = true; // 1. Save order to server.