[FIX] account: bank statement reconciliation

To determine the account.move.line to reconcile, first it tries to match with
the ref and the amount of the account.bank.statement.line and if it doesn't match,
it just tries to match with the amount.

opw:643867
This commit is contained in:
Goffin Simon 2015-07-02 17:01:05 +02:00
parent 1ab007a843
commit 72ec0050b4
1 changed files with 5 additions and 1 deletions

View File

@ -572,7 +572,11 @@ class account_bank_statement_line(osv.osv):
# Look for a matching amount
domain_exact_amount = domain + [(amount_field, '=', float_round(sign * amount, precision_digits=precision_digits))]
match_id = self.get_move_lines_for_reconciliation(cr, uid, st_line, excluded_ids=excluded_ids, offset=0, limit=2, additional_domain=domain_exact_amount)
domain_exact_amount_ref = domain_exact_amount + [('ref', '=', st_line.ref)]
match_id = self.get_move_lines_for_reconciliation(cr, uid, st_line, excluded_ids=excluded_ids, offset=0, limit=2, additional_domain=domain_exact_amount_ref)
if not match_id:
match_id = self.get_move_lines_for_reconciliation(cr, uid, st_line, excluded_ids=excluded_ids, offset=0, limit=2, additional_domain=domain_exact_amount)
if match_id and len(match_id) == 1:
return match_id