Skip to content

Commit

Permalink
Merge commit '203129a0349a9e3b5b4c951d948a8e930549d90e' into 13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
renzo-brown committed Apr 13, 2022
2 parents 69b50fd + 203129a commit 2c15905
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions pos_payment_terminal/static/src/js/payment_terminal.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ odoo.define("pos_payment_terminal.payment", function(require) {
return this._oca_payment_terminal_pay();
},

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

_oca_payment_terminal_pay: function() {
var order = this.pos.get_order();
var pay_line = order.selected_paymentline;
Expand Down Expand Up @@ -169,10 +179,11 @@ odoo.define("pos_payment_terminal.payment", function(require) {
},

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

0 comments on commit 2c15905

Please sign in to comment.