Skip to content

Commit

Permalink
[FIX] pos_payment_terminal: reject cancellation
Browse files Browse the repository at this point in the history
Since we can't cancel the transaction, we return a rejected
promise. The user should cancel manually which will
effectively free the transaction and let the user delete it.
  • Loading branch information
sbidoul authored and thomaspaulb committed Mar 30, 2022
1 parent ef3105b commit 203129a
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions pos_payment_terminal/static/src/js/payment_terminal.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ odoo.define("pos_payment_terminal.payment", function(require) {

send_payment_cancel: function() {
this._super.apply(this, arguments);
this._show_tip(
this._show_error(
_t(
"Cancel the transaction by pressing the red button on the payment terminal."
"Please press the red button on the payment terminal to cancel the transaction."
)
);
return Promise.resolve();
return Promise.reject();
},

_oca_payment_terminal_pay: function() {
Expand Down Expand Up @@ -185,14 +185,6 @@ odoo.define("pos_payment_terminal.payment", function(require) {
body: msg,
});
},

_show_tip: function(msg, title) {
if (!_.isEmpty(this.pos.gui.popup_instances))
this.pos.gui.show_popup("alert", {
title: title || _t("Payment Terminal"),
body: msg,
});
},
});
return OCAPaymentTerminal;
});

0 comments on commit 203129a

Please sign in to comment.