From fea9c1bc58af70cd4235902278c2704c6a3c25bc Mon Sep 17 00:00:00 2001 From: Omar Date: Thu, 7 Apr 2016 17:53:12 +0200 Subject: [PATCH] [FIX] account_bank_statement_import: If not found bank account on statement vals, partner_id always was being null. --- .../models/account_bank_statement_import.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 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 d47bfe8..a1c6d8a 100644 --- a/account_bank_statement_import/models/account_bank_statement_import.py +++ b/account_bank_statement_import/models/account_bank_statement_import.py @@ -351,8 +351,10 @@ class AccountBankStatementImport(models.TransientModel): 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 + if partner_id: + line_vals['partner_id'] = partner_id + if bank_account_id: + line_vals['bank_account_id'] = bank_account_id if 'date' in stmt_vals and 'period_id' not in stmt_vals: # if the parser found a date but didn't set a period for this date, # do this now