[FIX] UnboundLocalError: local variable 'payment_lines' referenced before assignment (Dmitrijs Ledkovs)

This commit is contained in:
Stefan Rijnhart
2011-11-01 16:30:44 +01:00

View File

@@ -533,6 +533,7 @@ class banking_import(osv.osv_memory):
imported_statement_ids = [] imported_statement_ids = []
linked_payments = {} linked_payments = {}
linked_invoices = {} linked_invoices = {}
payment_lines = []
if statements: if statements:
# Get default defaults # Get default defaults
@@ -571,8 +572,6 @@ class banking_import(osv.osv_memory):
payment_line_ids = [x[0] for x in cursor.fetchall()] payment_line_ids = [x[0] for x in cursor.fetchall()]
if payment_line_ids: if payment_line_ids:
payment_lines = payment_line_obj.browse(cursor, uid, payment_line_ids) payment_lines = payment_line_obj.browse(cursor, uid, payment_line_ids)
else:
payment_lines = []
for statement in statements: for statement in statements:
if statement.local_account in error_accounts: if statement.local_account in error_accounts: