From 8cdbd4028e32bddd6b840d89e5391a56e211689a Mon Sep 17 00:00:00 2001
From: "Pieter J. Kersten"
Date: Fri, 29 Jan 2010 11:28:00 +0100
Subject: [PATCH] [FIX] exception when no suitable period found
---
account_banking/wizard/bank_import.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/account_banking/wizard/bank_import.py b/account_banking/wizard/bank_import.py
index fb1d8266a..190a67894 100644
--- a/account_banking/wizard/bank_import.py
+++ b/account_banking/wizard/bank_import.py
@@ -385,6 +385,9 @@ def _banking_import_statements_file(self, cursor, uid, data, context):
period_id = get_period(pool, cursor, uid,
transaction.effective_date, company,
log)
+ if not period_id:
+ no_trans_skipped += 1
+ continue
# Credit means payment... isn't it?
if transaction.transferred_amount < 0 and payment_lines: