Skip to content

Commit

Permalink
[FIX] check current config payment methods to force or not the use of…
Browse files Browse the repository at this point in the history
… the proxy + do not enable it if the proxy_ip has not been set
  • Loading branch information
benwillig committed Jul 9, 2024
1 parent 6ce540e commit 977abf9
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions pos_payment_terminal/static/src/js/models.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,16 @@ odoo.define("pos_payment_terminal.models", function (require) {
class extends OriginalPosGlobalState {
// @override
async after_load_server_data() {
for (var payment_method_id in this.payment_methods) {
var payment_method = this.payment_methods[payment_method_id];
if (
payment_method.use_payment_terminal === "oca_payment_terminal"
) {
this.config.use_proxy = true;
if (this.config.proxy_ip) {
for (var index in this.config.payment_method_ids) {
var payment_method_id = this.config.payment_method_ids[index];
var payment_method = this.payment_methods[payment_method_id];
if (
payment_method.use_payment_terminal ===
"oca_payment_terminal"
) {
this.config.use_proxy = true;
}
}
}
return await super.after_load_server_data(...arguments);
Expand Down

0 comments on commit 977abf9

Please sign in to comment.