From a2489f7c594449ca606a91a88bbfedfd17688543 Mon Sep 17 00:00:00 2001 From: qdp-odoo Date: Mon, 17 Feb 2020 15:13:48 +0000 Subject: [PATCH] [REV] account: reverse entry when account move line contains 0 in credit or debit This reverts commit db691dbebf27d2c0169b1528dd79862decd0b05e because the appropriate solution was to filter lines with 0 debit and credit during the reverse_move before the reconciliation (which apparently has already been done by another patch). This patch, however, was causing the followup report to show lines on a receivable account with a partner and 0 balance with 0 way to remove them. X-original-commit: 6a5271b7f4109a4f2a20378698fbe479d73ed9cb --- addons/account/models/account_move.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index c273bd35c72..aa40757ff2b 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -3096,7 +3096,7 @@ class AccountMoveLine(models.Model): #computing the `reconciled` field. reconciled = False digits_rounding_precision = line.company_id.currency_id.rounding - if (line.matched_debit_ids or line.matched_credit_ids) and float_is_zero(amount, precision_rounding=digits_rounding_precision): + if float_is_zero(amount, precision_rounding=digits_rounding_precision): if line.currency_id and line.amount_currency: if float_is_zero(amount_residual_currency, precision_rounding=line.currency_id.rounding): reconciled = True @@ -3783,7 +3783,7 @@ class AccountMoveLine(models.Model): for line in self: company_ids.add(line.company_id.id) all_accounts.append(line.account_id) - if (line.matched_debit_ids or line.matched_credit_ids) and line.reconciled: + if line.reconciled: raise UserError(_('You are trying to reconcile some entries that are already reconciled.')) if len(company_ids) > 1: raise UserError(_('To reconcile the entries company should be the same for all entries.'))