From 2d7a57d03e182d29d789e73b907ff3b22f8a1478 Mon Sep 17 00:00:00 2001 From: Antoine Prieels Date: Mon, 20 Jan 2020 13:55:23 +0000 Subject: [PATCH] [FIX] point_of_sale: Cancel payment when switching to floor plan Payments that used terminals were not correctly canceled when switching to the floor plan because there was no selected order. If a response was received at that time, a traceback appeared. X-original-commit: f9214eed9774dcddc57deb536dfcd23572972184 --- addons/point_of_sale/static/src/js/screens.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js index 4700df3c0f8..2eb8c34b6cf 100644 --- a/addons/point_of_sale/static/src/js/screens.js +++ b/addons/point_of_sale/static/src/js/screens.js @@ -2256,14 +2256,14 @@ var PaymentScreenWidget = ScreenWidget.extend({ watch_order_changes: function() { var self = this; var order = this.pos.get_order(); - if (!order) { - return; - } if(this.old_order){ this.old_order.stop_electronic_payment(); this.old_order.unbind(null, null, this); this.old_order.paymentlines.unbind(null, null, this); } + if (!order) { + return; + } order.bind('all',function(){ self.order_changes(); });