diff --git a/addons/account_bank_statement_import/account_bank_statement_import.py b/addons/account_bank_statement_import/account_bank_statement_import.py index 6ea8c4d266c..aebdc80644b 100644 --- a/addons/account_bank_statement_import/account_bank_statement_import.py +++ b/addons/account_bank_statement_import/account_bank_statement_import.py @@ -46,6 +46,8 @@ class AccountBankStatementImport(models.TransientModel): stmts_vals = self._complete_stmts_vals(stmts_vals, journal, account_number) # Create the bank statements statement_ids, notifications = self._create_bank_statements(stmts_vals) + # Now that the import worked out, set it as the bank_statements_source of the journal + journal.bank_statements_source = 'file_import' # Finally dispatch to reconciliation interface action = self.env.ref('account.action_bank_reconcile_bank_statements') return { @@ -73,7 +75,6 @@ class AccountBankStatementImport(models.TransientModel): 'default_name': _('Bank') + ' ' + account_number, 'default_currency_id': currency and currency.id or False, 'default_type': 'bank', - 'default_bank_statements_source': 'file_import', } } diff --git a/addons/account_bank_statement_import/account_journal.py b/addons/account_bank_statement_import/account_journal.py index 35267234bc6..7964ecc9aec 100644 --- a/addons/account_bank_statement_import/account_journal.py +++ b/addons/account_bank_statement_import/account_journal.py @@ -10,7 +10,6 @@ class AccountJournal(models.Model): @api.multi def import_statement(self): """return action to import bank/cash statements. This button should be called only on journals with type =='bank'""" - self.bank_statements_source = 'file_import' model = 'account.bank.statement' action_name = 'action_account_bank_statement_import' ir_model_obj = self.pool['ir.model.data']