From ae742db21d1a192074250612f2ccd4eb548256c9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= <stephane.bidoul@acsone.eu>
Date: Tue, 16 Sep 2014 15:01:03 +0200
Subject: [PATCH] [IMP] broaden scope of search of bank statement
 reconciliation candidates

Looking for accounts with reconcile=True is enough.
Restricting on payable/receivable account types narrows the search
to much and makes it difficult to implement transfer account holding
the payment while they are in transit at the bank.
---
 addons/account/account_bank_statement.py | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py
index c606791a813c..6ef417c91d83 100644
--- a/addons/account/account_bank_statement.py
+++ b/addons/account/account_bank_statement.py
@@ -587,13 +587,9 @@ class account_bank_statement_line(osv.osv):
         mv_line_pool = self.pool.get('account.move.line')
 
         # Make domain
-        domain = additional_domain + [('reconcile_id', '=', False), ('state', '=', 'valid')]
+        domain = additional_domain + [('reconcile_id', '=', False), ('state', '=', 'valid'), ('account_id.reconcile', '=', True)]
         if st_line.partner_id.id:
-            domain += [('partner_id', '=', st_line.partner_id.id),
-                '|', ('account_id.type', '=', 'receivable'),
-                ('account_id.type', '=', 'payable')]
-        else:
-            domain += [('account_id.reconcile', '=', True), ('account_id.type', '=', 'other')]
+            domain += [('partner_id', '=', st_line.partner_id.id)]
         if excluded_ids:
             domain.append(('id', 'not in', excluded_ids))
         if str:
-- 
GitLab