[MERGE] forward port branch 11.0 up to cd1b56b41f

This commit is contained in:
Christophe Simonis
2019-09-04 16:31:43 +02:00
+4 -2
View File
@@ -118,8 +118,10 @@ class AccountInvoice(models.Model):
if line.currency_id == self.currency_id:
residual += line.amount_residual_currency if line.currency_id else line.amount_residual
else:
from_currency = (line.currency_id and line.currency_id.with_context(date=line.date)) or line.company_id.currency_id.with_context(date=line.date)
residual += from_currency.compute(line.amount_residual, self.currency_id)
if line.currency_id:
residual += line.currency_id.with_context(date=line.date).compute(line.amount_residual_currency, self.currency_id)
else:
residual += line.company_id.currency_id.with_context(date=line.date).compute(line.amount_residual, self.currency_id)
self.residual_company_signed = abs(residual_company_signed) * sign
self.residual_signed = abs(residual) * sign
self.residual = abs(residual)