From 042e7862bea7dad735cef4a46b81b4e44cec45de Mon Sep 17 00:00:00 2001 From: Olivier Colson Date: Mon, 11 Jun 2018 11:13:52 +0200 Subject: [PATCH] [FIX] account: properly link bank account created via setup wizard with existing journals when choosing to do so [IMP] account_bank_statement_import: bank account manual configuration wizard: when linking to an existing journal, change its statements source if the journal had an 'undefined' source. --- addons/account/wizard/setup_wizards.py | 2 ++ addons/account_bank_statement_import/wizard/setup_wizards.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/account/wizard/setup_wizards.py b/addons/account/wizard/setup_wizards.py index 31011d55e22..7982ee91f70 100644 --- a/addons/account/wizard/setup_wizards.py +++ b/addons/account/wizard/setup_wizards.py @@ -100,6 +100,8 @@ class SetupBarBankConfigWizard(models.TransientModel): 'company_id': company.id, 'bank_account_id': record.res_partner_bank_id.id, }) + else: + selected_journal.bank_account_id = record.res_partner_bank_id.id def validate(self): """ Called by the validation button of this wizard. Serves as an diff --git a/addons/account_bank_statement_import/wizard/setup_wizards.py b/addons/account_bank_statement_import/wizard/setup_wizards.py index ef811b73029..81ca3b873f1 100644 --- a/addons/account_bank_statement_import/wizard/setup_wizards.py +++ b/addons/account_bank_statement_import/wizard/setup_wizards.py @@ -10,5 +10,5 @@ class SetupBarBankConfigWizard(models.TransientModel): """ Default the bank statement source of new bank journals as 'file_import' """ super(SetupBarBankConfigWizard, self).validate() - if self.create_or_link_option == 'new': + if self.create_or_link_option == 'new' or self.linked_journal_id.bank_statements_source == 'undefined': self.linked_journal_id.bank_statements_source = 'file_import'