| 1 | import OrderPaymentValidation from "@point_of_sale/app/utils/order_payment_validation"; |
| 2 | import { patch } from "@web/core/utils/patch"; |
| 3 | |
| 4 | patch(OrderPaymentValidation.prototype, { |
| 5 | async afterOrderValidation() { |
| 6 | const lines = this.order.lines.filter( |
| 7 | (e) => e.sale_order_origin_id && e.down_payment_details |
| 8 | ); |
| 9 | if (lines.length > 0) { |
| 10 | const orders = [...new Set(lines.map((e) => e.sale_order_origin_id))]; |
| 11 | await this.pos.data.read( |
| 12 | "sale.order.line", |
| 13 | orders.flatMap((o) => o.order_line).map((ol) => ol.id) |
| 14 | ); |
| 15 | } |
| 16 | await super.afterOrderValidation(); |
| 17 | }, |
| 18 | }); |