[FIX] point_of_sale: remove 0€ payment line of orders
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) <jcb@odoo.com> Signed-off-by: Robin Engels (roen) <roen@odoo.com>
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user