From 7070dc682c32d219649a49fba627981f071c724e Mon Sep 17 00:00:00 2001 From: Stefan Rijnhart Date: Wed, 11 Jul 2012 12:37:31 +0200 Subject: [PATCH] [FIX] Unclear error message when no period exists for bank statement date --- account_banking/wizard/bank_import.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/account_banking/wizard/bank_import.py b/account_banking/wizard/bank_import.py index 6e2139341..9dc222272 100644 --- a/account_banking/wizard/bank_import.py +++ b/account_banking/wizard/bank_import.py @@ -263,6 +263,16 @@ class banking_import(osv.osv_memory): ('date_stop','>=',statement.date), ('special', '=', False)]) + if not period_ids: + results.log.append( + _('No period found covering statement date %(date)s, ' + 'statement %(id)s skipped') % { + 'date': statement.date, + 'id': statement.id, + } + ) + continue + # Create the bank statement record statement_id = statement_obj.create(cursor, uid, dict( name = statement.id,