account_usability: Improve onchange for amount_currency
This commit is contained in:
@@ -409,9 +409,7 @@ class AccountMoveLine(models.Model):
|
|||||||
prec = self.env['decimal.precision'].precision_get('Account')
|
prec = self.env['decimal.precision'].precision_get('Account')
|
||||||
if (
|
if (
|
||||||
self.currency_id and
|
self.currency_id and
|
||||||
self.amount_currency and
|
not float_is_zero(self.amount_currency, precision_digits=prec)):
|
||||||
float_is_zero(self.credit, precision_digits=prec) and
|
|
||||||
float_is_zero(self.debit, precision_digits=prec)):
|
|
||||||
date = self.date or None
|
date = self.date or None
|
||||||
amount_company_currency = self.currency_id.with_context(
|
amount_company_currency = self.currency_id.with_context(
|
||||||
date=date).compute(
|
date=date).compute(
|
||||||
|
|||||||
Reference in New Issue
Block a user