[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.
This commit is contained in:
Olivier Colson
2018-06-11 11:18:57 +02:00
parent 5e9cd951d6
commit 042e7862be
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -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
@@ -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'