mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[FIX] pos_pax: chrome creats many requests
Appears to be bad click handling, as the 'click' is processed, but I also wrapped the ternary operators in case browsers handle that differently (.. I've seen 5+ requests...)
This commit is contained in:
@@ -189,7 +189,7 @@ PaymentScreenWidget.include({
|
|||||||
});
|
});
|
||||||
|
|
||||||
PAX.mDestinationIP = this.pos.config.pax_endpoint;
|
PAX.mDestinationIP = this.pos.config.pax_endpoint;
|
||||||
PAX[(tender_type == 'debit') ? 'DoDebit' : 'DoCredit'](transaction, function (response) {
|
PAX[((tender_type == 'debit') ? 'DoDebit' : 'DoCredit')](transaction, function (response) {
|
||||||
console.log(response);
|
console.log(response);
|
||||||
var parsed_response = self.pos.decodePAXResponse(response);
|
var parsed_response = self.pos.decodePAXResponse(response);
|
||||||
if (parsed_response.fail) {
|
if (parsed_response.fail) {
|
||||||
@@ -252,7 +252,7 @@ PaymentScreenWidget.include({
|
|||||||
}
|
}
|
||||||
|
|
||||||
PAX.mDestinationIP = this.pos.config.pax_endpoint;
|
PAX.mDestinationIP = this.pos.config.pax_endpoint;
|
||||||
PAX[(line.pax_tender_type == 'debit') ? 'DoDebit' : 'DoCredit'](transaction, function (response) {
|
PAX[((line.pax_tender_type == 'debit') ? 'DoDebit' : 'DoCredit')](transaction, function (response) {
|
||||||
var parsed_response = self.pos.decodePAXResponse(response);
|
var parsed_response = self.pos.decodePAXResponse(response);
|
||||||
if (parsed_response.fail) {
|
if (parsed_response.fail) {
|
||||||
def.resolve({message: parsed_response.fail})
|
def.resolve({message: parsed_response.fail})
|
||||||
@@ -330,10 +330,10 @@ PaymentScreenWidget.include({
|
|||||||
render_paymentlines: function() {
|
render_paymentlines: function() {
|
||||||
this._super();
|
this._super();
|
||||||
var self = this;
|
var self = this;
|
||||||
self.$('.paymentlines-container').on('click', '.pax_send_transaction', function(){
|
self.$('.paymentlines-container .pax_send_transaction').on('click', null, function(){
|
||||||
self.click_pax_send_transaction('credit');
|
self.click_pax_send_transaction('credit');
|
||||||
});
|
});
|
||||||
self.$('.paymentlines-container').on('click', '.pax_send_transaction_debit', function(){
|
self.$('.paymentlines-container .pax_send_transaction_debit').on('click', null, function(){
|
||||||
self.click_pax_send_transaction('debit');
|
self.click_pax_send_transaction('debit');
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user