From 11f8e8db4c3a12c2375d210b199e66ebfa1553b0 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 4 Nov 2015 13:57:43 +0100 Subject: [PATCH] [FIX] account: get_reconciliation_proposition The bank statement reconciliation widget should look for the name of the account.move if the ref is not found. opw:652656 --- addons/account/models/account_bank_statement.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py index 932d5ca2d12..09a2260f228 100644 --- a/addons/account/models/account_bank_statement.py +++ b/addons/account/models/account_bank_statement.py @@ -566,6 +566,13 @@ class AccountBankStatementLine(models.Model): match_recs = self.get_move_lines_for_reconciliation(excluded_ids=excluded_ids, limit=2, additional_domain=domain, overlook_partner=overlook_partner) if match_recs and len(match_recs) == 1: return match_recs + elif len(match_recs) == 0: + move = self.env['account.move'].search([('name', '=', self.name)], limit=1) + if move: + domain = [('move_id', '=', move.id)] + match_recs = self.get_move_lines_for_reconciliation(excluded_ids=excluded_ids, limit=2, additional_domain=domain, overlook_partner=overlook_partner) + if match_recs and len(match_recs) == 1: + return match_recs # How to compare statement line amount and move lines amount amount_domain_maker = self._get_domain_maker_move_line_amount()