[FIX] UnboundLocalError: local variable 'payment_lines' referenced before assignment

When trying to import first statement and no other statements are present.
This commit is contained in:
Dmitrijs Ledkovs
2011-11-01 14:50:47 +00:00
parent f228acec94
commit aa25b82dd6

View File

@@ -598,6 +598,7 @@ class banking_import(wizard.interface):
error_accounts = {}
info = {}
imported_statement_ids = []
payment_lines = []
if statements:
# Get default defaults
@@ -635,8 +636,6 @@ class banking_import(wizard.interface):
payment_line_ids = [x[0] for x in cursor.fetchall()]
if payment_line_ids:
payment_lines = payment_line_obj.browse(cursor, uid, payment_line_ids)
else:
payment_lines = []
for statement in statements:
if statement.local_account in error_accounts: