[FIX] account_bank_statement_import: Handle correctly the selection of the journal

This commit is contained in:
Pedro M. Baeza
2015-06-23 16:37:06 +02:00
committed by Víctor Martínez
parent 7d9c138d4b
commit 8a75fab19f

View File

@@ -15,21 +15,6 @@ class AccountBankStatementImport(models.TransientModel):
def _get_hide_journal_field(self):
return self.env.context.get('journal_id') and True
@api.model
def _get_journal(self, currency_id, bank_account_id, account_number):
""" As .QIF format does not allow us to detect the journal, we need to
let the user choose it.
We set it in context before to call super so it's the same as
calling the widget from a journal """
record = self
active_id = self.env.context.get('active_id')
if active_id:
record = self.browse(active_id)
if record.journal_id:
record = record.with_context(journal_id=record.journal_id.id)
return super(AccountBankStatementImport, record)._get_journal(
currency_id, bank_account_id, account_number)
@api.model
def _check_qif(self, data_file):
return data_file.strip().startswith('!Type:')