[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"
@@ -42,7 +42,7 @@ msgstr ""
#: code:addons/account_statement_import_file/wizard/account_statement_import.py:0 #: code:addons/account_statement_import_file/wizard/account_statement_import.py:0
#, python-format #, python-format
msgid "" msgid ""
"Could not find any bank account with number '%(account_number)s' linked to " "Could not find any bank account with number '%(account_number)s' linked to "
"partner '%(partner_name)s'. You should create the bank account and set it on" "partner '%(partner_name)s'. You should create the bank account and set it on"
" the related bank journal. If the related bank journal doesn't exist yet, " " the related bank journal. If the related bank journal doesn't exist yet, "
"you should create a new one." "you should create a new one."
@@ -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"
@@ -168,7 +163,7 @@ msgstr ""
msgid "" msgid ""
"The bank account with number '%(account_number)s' exists in Odoo but it is " "The bank account with number '%(account_number)s' exists in Odoo but it is "
"not set on any bank journal. You should set it on the related bank journal. " "not set on any bank journal. You should set it on the related bank journal. "
"If the related bank journal doesn't exist yet, you should create a new one." "If the related bank journal doesn't exist yet, you should create a new one."
msgstr "" msgstr ""
#. module: account_statement_import_file #. module: account_statement_import_file

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):