[FIX] account: payment onchange in multi currencies
Computation of the field 'Difference amount' was wrong as it was converting amounts in base currency in the following use case: - company currency USD - invoice currency EUR - payment's journal currency USD but payment's currency EUR - invoice of 100€, payment of 20€: difference was not 80€ because it was converting to USD
This commit is contained in:
@@ -91,7 +91,7 @@ class account_abstract_payment(models.AbstractModel):
|
||||
total = 0
|
||||
for inv in self.invoice_ids:
|
||||
if inv.currency_id == payment_currency:
|
||||
total += inv.residual_company_signed
|
||||
total += inv.residual_signed
|
||||
else:
|
||||
total += inv.company_currency_id.with_context(date=self.payment_date).compute(
|
||||
inv.residual_company_signed, payment_currency)
|
||||
|
||||
Reference in New Issue
Block a user