[FIX] account: fixed computation of reconciled fields on account.move.line and account.invoice which were wrong due to bad usage of float_is_zero()
This commit is contained in:
@@ -81,7 +81,7 @@ class AccountBankStatement(models.Model):
|
||||
@api.multi
|
||||
def _is_difference_zero(self):
|
||||
for bank_stmt in self:
|
||||
bank_stmt.is_difference_zero = float_is_zero(bank_stmt.difference, bank_stmt.currency_id.decimal_places)
|
||||
bank_stmt.is_difference_zero = float_is_zero(bank_stmt.difference, precision_digits=bank_stmt.currency_id.decimal_places)
|
||||
|
||||
@api.one
|
||||
@api.depends('journal_id')
|
||||
|
||||
@@ -97,7 +97,7 @@ class AccountInvoice(models.Model):
|
||||
self.residual_signed = abs(residual) * sign
|
||||
self.residual = abs(residual)
|
||||
digits_rounding_precision = self.currency_id.rounding
|
||||
if float_is_zero(self.residual, digits_rounding_precision):
|
||||
if float_is_zero(self.residual, precision_rounding=digits_rounding_precision):
|
||||
self.reconciled = True
|
||||
else:
|
||||
self.reconciled = False
|
||||
|
||||
@@ -254,7 +254,7 @@ class AccountMoveLine(models.Model):
|
||||
#we can only check the amount in company currency
|
||||
reconciled = False
|
||||
digits_rounding_precision = line.company_id.currency_id.rounding
|
||||
if float_is_zero(amount, digits_rounding_precision) and (line.debit or line.credit):
|
||||
if float_is_zero(amount, precision_rounding=digits_rounding_precision) and (line.debit or line.credit):
|
||||
reconciled = True
|
||||
line.reconciled = reconciled
|
||||
|
||||
|
||||
Reference in New Issue
Block a user