[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:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user