[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
This commit is contained in:
Antoine Prieels
2020-01-28 09:00:34 +00:00
parent d3ab09cb0f
commit 2d7a57d03e
@@ -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();
});