Skip to content

Commit

Permalink
[FIX] account_payment: send amount in right currency
Browse files Browse the repository at this point in the history
While sending payment request to acquirer
the amount used was the amout_residual_signed

This amound is in the currency of the company
and may be negative.

The currency send to the acquirer is the
currency on the invoice so you expect the
amount to be in the same currency and
being positive

amount_residual is exactly that amount

Solution: user amount_residual
          instead of amount_residual_signed

closes odoo#46039

Signed-off-by: Laurent Smet <[email protected]>
  • Loading branch information
tfr-odoo committed Feb 24, 2020
1 parent abce77f commit 1d1d5e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addons/account_payment/models/payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def render_invoice_button(self, invoice, submit_txt=None, render_values=None):
values.update(render_values)
return self.acquirer_id.with_context(submit_class='btn btn-primary', submit_txt=submit_txt or _('Pay Now')).sudo().render(
self.reference,
invoice.amount_residual_signed,
invoice.amount_residual,
invoice.currency_id.id,
values=values,
)

0 comments on commit 1d1d5e2

Please sign in to comment.