[17.0][ADD] account_statement_import_file: add file to statement's field attachment_ids

This commit is contained in:
manu
2024-05-13 11:48:45 +02:00
committed by Duy (Đỗ Anh)
parent 3771300d83
commit 44fca05ac4
2 changed files with 9 additions and 9 deletions

View File

@@ -4,7 +4,7 @@
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 16.0\n" "Project-Id-Version: Odoo Server 17.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@@ -110,11 +110,6 @@ msgstr ""
msgid "Journal" msgid "Journal"
msgstr "" msgstr ""
#. module: account_statement_import_file
#: model:ir.model.fields,field_description:account_statement_import_file.field_account_statement_import____last_update
msgid "Last Modified on"
msgstr ""
#. module: account_statement_import_file #. module: account_statement_import_file
#: model:ir.model.fields,field_description:account_statement_import_file.field_account_statement_import__write_uid #: model:ir.model.fields,field_description:account_statement_import_file.field_account_statement_import__write_uid
msgid "Last Updated by" msgid "Last Updated by"

View File

@@ -39,7 +39,12 @@ class AccountStatementImport(models.TransientModel):
"only contains already imported transactions." "only contains already imported transactions."
) )
) )
self.env["ir.attachment"].create(self._prepare_create_attachment(result)) attachment = self.env["ir.attachment"].create(
self._prepare_create_attachment(result)
)
for statement_id in result["statement_ids"]:
statement = self.env["account.bank.statement"].browse(statement_id)
statement.write({"attachment_ids": [(4, attachment.id)]})
return result return result
def import_file_button(self): def import_file_button(self):