mirror of
https://github.com/OCA/bank-statement-import.git
synced 2025-01-20 12:37:43 +02:00
account_bank_statement_import_save_file: Fix filename
This commit is contained in:
@@ -20,19 +20,21 @@ class AccountBankStatementImport(models.TransientModel):
|
||||
self.env['account.bank.statement'].browse(statement_ids).write({
|
||||
'import_file': self.env['ir.attachment'].create(
|
||||
self._create_import_file_attachment_data(
|
||||
data_file, statement_ids[0], notifications)).id,
|
||||
data_file, statement_ids[0], notifications,
|
||||
self.filename)).id,
|
||||
})
|
||||
return action
|
||||
|
||||
@api.model
|
||||
def _create_import_file_attachment_data(self, data_file, statement_id,
|
||||
notifications):
|
||||
notifications, filename=None):
|
||||
return {
|
||||
'name': '<unknown>',
|
||||
'name': filename or '<unknown>',
|
||||
'res_model': 'account.bank.statement',
|
||||
'res_id': statement_id,
|
||||
'type': 'binary',
|
||||
'datas': base64.b64encode(data_file),
|
||||
'datas_fname': filename or '<unknown>',
|
||||
'description': '\n'.join(
|
||||
'%(type)s: %(message)s' % notification
|
||||
for notification in notifications) or False,
|
||||
|
||||
Reference in New Issue
Block a user