[IMP] broaden scope of search of bank statement reconciliation candidates
authorStéphane Bidoul <stephane.bidoul@acsone.eu>
Tue, 16 Sep 2014 13:01:03 +0000 (15:01 +0200)
committerqdp-odoo <qdp@openerp.com>
Wed, 17 Sep 2014 12:24:24 +0000 (14:24 +0200)
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

index c606791..6ef417c 100644 (file)
@@ -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: