Skip to content

Commit

Permalink
[FIX] pos_financial_risk: PaymentScreen payment method compute is fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
geomer198 committed Sep 24, 2023
1 parent ec3e108 commit 6e833ea
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pos_financial_risk/static/src/js/PaymentScreen.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const PaymentScreenRisk = (PaymentScreen) =>
const partner = order.partner;
if (!partner) {
this.payment_methods_from_config = this.paymentMethodsFromConfigBase;
this.render(true);
return;
}
const paymentCreditLimit =
Expand All @@ -30,9 +31,9 @@ export const PaymentScreenRisk = (PaymentScreen) =>
this.rpc({
model: "res.partner",
method: "read",
args: [partner.id, ["risk_remaining_percentage"]],
args: [partner.id, ["risk_remaining_value"]],
}).then((partnerFields) => {
if (orderTotal > partnerFields[0].risk_remaining_percentage) {
if (orderTotal > partnerFields[0].risk_remaining_value) {
if (paymentCreditLimit.length > 0) {
this.payment_methods_from_config =
this.paymentMethodsFromConfigBase.filter(
Expand All @@ -44,11 +45,11 @@ export const PaymentScreenRisk = (PaymentScreen) =>
(method) => !method.credit_limit_restricted
);
}
this.render(true);
} else {
this.payment_methods_from_config =
this.paymentMethodsFromConfigBase;
}
this.render(true);
});
}
};
Expand Down

0 comments on commit 6e833ea

Please sign in to comment.