From 68f0b8fe4e184e8088c6475d0b9e157f43eb684b Mon Sep 17 00:00:00 2001 From: qdp-odoo Date: Fri, 8 Jul 2016 16:57:06 +0200 Subject: [PATCH] [FIX] account: bank reconciliation was auto-reconciling undistincly debit lines on bank accounts with negative amounts and/or credit lines with positive amounts where only one field (debit/credit) should be checked if the amount is positive/negative. --- addons/account/models/account_bank_statement.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py index f6d88bc3b36..b351c53ef71 100644 --- a/addons/account/models/account_bank_statement.py +++ b/addons/account/models/account_bank_statement.py @@ -576,10 +576,11 @@ class AccountBankStatementLine(models.Model): domain = [(f, '>', 0), (f, '<', amount)] elif comparator == '=': if f == 'amount_residual': + liquidity_field = amount > 0 and 'debit' or 'credit' domain = [ '|', (f, '=', float_round(amount, precision_digits=p)), '&', ('account_id.internal_type', '=', 'liquidity'), - '|', ('debit', '=', amount), ('credit', '=', amount), + (liquidity_field, '=', amount), ] else: domain = [