diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index 95d96ae3726..d7982b538ed 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -2436,6 +2436,14 @@ var PaymentScreenWidget = ScreenWidget.extend({ // and complete the sale process validate_order: function(force_validation) { if (this.order_is_valid(force_validation)) { + // remove pending payments before finalizing the validation + var order = this.pos.get_order(); + order.get_paymentlines().forEach(line => { + if (!line.is_done()) { + order.remove_paymentline(line); + } + }); + this.render_paymentlines(); this.finalize_validation(); } }, diff --git a/addons/pos_mercury/static/src/js/pos_mercury.js b/addons/pos_mercury/static/src/js/pos_mercury.js index 70e9db8f3d2..d5663b38d57 100644 --- a/addons/pos_mercury/static/src/js/pos_mercury.js +++ b/addons/pos_mercury/static/src/js/pos_mercury.js @@ -642,23 +642,6 @@ PaymentScreenWidget.include({ this.pos.barcode_reader.set_action_callback('credit', _.bind(this.credit_code_action, this)); } }, - - // before validating, get rid of any paymentlines that are waiting - // on a swipe. - validate_order: function(force_validation) { - if (this.pos.get_order().is_paid() && ! this.invoicing) { - var lines = this.pos.get_order().get_paymentlines(); - - for (var i = 0; i < lines.length; i++) { - if (lines[i].mercury_swipe_pending) { - this.pos.get_order().remove_paymentline(lines[i]); - this.render_paymentlines(); - } - } - } - - this._super(force_validation); - } }); });