summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine Prieels <anp@odoo.com>2020-01-20 13:55:23 +0000
committerAntoine Prieels <anp@odoo.com>2020-01-28 09:00:34 +0000
commit2d7a57d03e182d29d789e73b907ff3b22f8a1478 (patch)
treeb78689e799498633ae430bedb3271b85b02e224e
parentd3ab09cb0f8872f6e826605c80224611cc5d0511 (diff)
[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
-rw-r--r--addons/point_of_sale/static/src/js/screens.js6
1 files 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();
});