[FIX] account_bank_statement_import: journal without default credit/debit account
A traceback was raised when importing a statement for a journal without default credit/debit account. opw:742196
This commit is contained in:
@@ -43,6 +43,8 @@ class AccountBankStatementImport(models.TransientModel):
|
||||
if not journal:
|
||||
# The active_id is passed in context so the wizard can call import_file again once the journal is created
|
||||
return self.with_context(active_id=self.ids[0])._journal_creation_wizard(currency, account_number)
|
||||
if not journal.default_debit_account_id or not journal.default_credit_account_id:
|
||||
raise UserError(_('You have to set a Default Debit Account and a Default Credit Account for the journal: %s') % (journal.name,))
|
||||
# Prepare statement data to be used for bank statements creation
|
||||
stmts_vals = self._complete_stmts_vals(stmts_vals, journal, account_number)
|
||||
# Create the bank statements
|
||||
|
||||
@@ -482,6 +482,12 @@ msgstr ""
|
||||
msgid "You have already imported that file."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_bank_statement_import
|
||||
#: code:addons/account_bank_statement_import/account_bank_statement_import.py:47
|
||||
#, python-format
|
||||
msgid "You have to set a Default Debit Account and a Default Credit Account for the journal: %s"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_bank_statement_import
|
||||
#: model:ir.ui.view,arch_db:account_bank_statement_import.account_bank_statement_import_view
|
||||
msgid "_Import"
|
||||
|
||||
Reference in New Issue
Block a user