From 862919fba05c846554e4c1352aa9e18c95dbbf06 Mon Sep 17 00:00:00 2001
From: Alexis de Lattre <alexis.delattre@akretion.com>
Date: Tue, 3 Nov 2015 23:21:51 +0100
Subject: [PATCH 1/2] FIX 2 variables had the same name (account_number) !!!

---
 .../models/account_bank_statement_import.py               | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/account_bank_statement_import/models/account_bank_statement_import.py b/account_bank_statement_import/models/account_bank_statement_import.py
index 3d2e8f7..e41099a 100644
--- a/account_bank_statement_import/models/account_bank_statement_import.py
+++ b/account_bank_statement_import/models/account_bank_statement_import.py
@@ -299,16 +299,16 @@ class AccountBankStatementImport(models.TransientModel):
                 # closed.
                 partner_id = False
                 bank_account_id = False
-                account_number = line_vals.get('account_number')
-                if account_number:
+                partner_account_number = line_vals.get('account_number')
+                if partner_account_number:
                     bank_model = self.env['res.partner.bank']
                     banks = bank_model.search(
-                        [('acc_number', '=', account_number)], limit=1)
+                        [('acc_number', '=', partner_account_number)], limit=1)
                     if banks:
                         bank_account_id = banks[0].id
                         partner_id = banks[0].partner_id.id
                     else:
-                        bank_obj = self._create_bank_account(account_number)
+                        bank_obj = self._create_bank_account(partner_account_number)
                         bank_account_id = bank_obj and bank_obj.id or False
                 line_vals['partner_id'] = partner_id
                 line_vals['bank_account_id'] = bank_account_id

From da47b902d020fbdf640daaa2c8e437cd2201bf25 Mon Sep 17 00:00:00 2001
From: Alexis de Lattre <alexis.delattre@akretion.com>
Date: Wed, 4 Nov 2015 11:06:46 +0100
Subject: [PATCH 2/2] PEP8 fix

---
 .../models/account_bank_statement_import.py                    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/account_bank_statement_import/models/account_bank_statement_import.py b/account_bank_statement_import/models/account_bank_statement_import.py
index e41099a..9a8b913 100644
--- a/account_bank_statement_import/models/account_bank_statement_import.py
+++ b/account_bank_statement_import/models/account_bank_statement_import.py
@@ -308,7 +308,8 @@ class AccountBankStatementImport(models.TransientModel):
                         bank_account_id = banks[0].id
                         partner_id = banks[0].partner_id.id
                     else:
-                        bank_obj = self._create_bank_account(partner_account_number)
+                        bank_obj = self._create_bank_account(
+                            partner_account_number)
                         bank_account_id = bank_obj and bank_obj.id or False
                 line_vals['partner_id'] = partner_id
                 line_vals['bank_account_id'] = bank_account_id