account_usability: Improve onchange for amount_currency

This commit is contained in:
Alexis de Lattre
2019-02-14 17:31:17 +01:00
parent 2b89e57d72
commit 6b3d2263c7

View File

@@ -409,9 +409,7 @@ class AccountMoveLine(models.Model):
prec = self.env['decimal.precision'].precision_get('Account')
if (
self.currency_id and
self.amount_currency and
float_is_zero(self.credit, precision_digits=prec) and
float_is_zero(self.debit, precision_digits=prec)):
not float_is_zero(self.amount_currency, precision_digits=prec)):
date = self.date or None
amount_company_currency = self.currency_id.with_context(
date=date).compute(