From f835f8302248ece838ba2f57654b4ff79454fd8e Mon Sep 17 00:00:00 2001 From: Sergio Zanchetta Date: Thu, 9 Sep 2021 21:41:20 +0200 Subject: [PATCH] [MIG] account_bank_statement_import_txt_xlsx: Migration to 14.0 [FIX] Mostly currency-related fixes [IMP] sample_statement_en test: add dates on description Co-authored-by: Marco Colombo --- .../models/__init__.py | 6 - .../readme/DESCRIPTION.rst | 2 - .../security/ir.model.access.csv | 3 - .../tests/fixtures/sample_statement_en.csv | 3 - .../tests/fixtures/sample_statement_en.xlsx | Bin 5092 -> 0 bytes .../README.rst | 18 +-- .../__init__.py | 0 .../__manifest__.py | 12 +- .../data/map_data.xml | 5 +- ...account_bank_statement_import_txt_xlsx.pot | 0 .../i18n/nl.po | 0 .../i18n/zh_CN.po | 0 .../models/__init__.py | 6 + .../models/account_journal.py | 2 +- .../models/account_statement_import.py | 10 +- .../account_statement_import_sheet_mapping.py | 6 +- .../account_statement_import_sheet_parser.py | 44 +++--- .../readme/CONFIGURE.rst | 0 .../readme/CONTRIBUTORS.rst | 0 .../readme/DESCRIPTION.rst | 2 + .../readme/HISTORY.rst | 0 .../readme/USAGE.rst | 0 .../security/ir.model.access.csv | 5 + .../static/description/icon.png | Bin .../static/description/index.html | 14 +- .../tests/__init__.py | 2 +- .../tests/fixtures/balance.csv | 0 .../tests/fixtures/debit_credit.csv | 0 .../tests/fixtures/empty_statement_en.csv | 0 .../tests/fixtures/empty_statement_en.xlsx | Bin .../tests/fixtures/multi_currency.csv | 0 .../tests/fixtures/original_currency.csv | 0 .../fixtures/original_currency_empty.csv | 0 .../tests/fixtures/sample_statement_en.csv | 3 + .../tests/fixtures/sample_statement_en.xlsx | Bin 0 -> 5101 bytes .../test_account_statement_import_txt_xlsx.py | 149 +++++++----------- .../views/account_journal_views.xml | 0 .../views/account_statement_import.xml | 8 +- ...account_statement_import_sheet_mapping.xml | 14 +- .../wizards/__init__.py | 2 +- ...t_statement_import_sheet_mapping_wizard.py | 20 +-- ..._statement_import_sheet_mapping_wizard.xml | 32 ++-- .../account_bank_statement_import_txt_xlsx | 1 - .../addons/account_statement_import_txt_xlsx | 1 + .../setup.py | 0 45 files changed, 173 insertions(+), 197 deletions(-) delete mode 100644 account_bank_statement_import_txt_xlsx/models/__init__.py delete mode 100644 account_bank_statement_import_txt_xlsx/readme/DESCRIPTION.rst delete mode 100644 account_bank_statement_import_txt_xlsx/security/ir.model.access.csv delete mode 100644 account_bank_statement_import_txt_xlsx/tests/fixtures/sample_statement_en.csv delete mode 100644 account_bank_statement_import_txt_xlsx/tests/fixtures/sample_statement_en.xlsx rename {account_bank_statement_import_txt_xlsx => account_statement_import_txt_xlsx}/README.rst (84%) rename {account_bank_statement_import_txt_xlsx => account_statement_import_txt_xlsx}/__init__.py (100%) rename {account_bank_statement_import_txt_xlsx => account_statement_import_txt_xlsx}/__manifest__.py (70%) rename {account_bank_statement_import_txt_xlsx => account_statement_import_txt_xlsx}/data/map_data.xml (89%) rename {account_bank_statement_import_txt_xlsx => account_statement_import_txt_xlsx}/i18n/account_bank_statement_import_txt_xlsx.pot (100%) rename {account_bank_statement_import_txt_xlsx => account_statement_import_txt_xlsx}/i18n/nl.po (100%) rename {account_bank_statement_import_txt_xlsx => account_statement_import_txt_xlsx}/i18n/zh_CN.po (100%) create mode 100644 account_statement_import_txt_xlsx/models/__init__.py rename {account_bank_statement_import_txt_xlsx => account_statement_import_txt_xlsx}/models/account_journal.py (88%) rename account_bank_statement_import_txt_xlsx/models/account_bank_statement_import.py => account_statement_import_txt_xlsx/models/account_statement_import.py (71%) rename account_bank_statement_import_txt_xlsx/models/account_bank_statement_import_sheet_mapping.py => account_statement_import_txt_xlsx/models/account_statement_import_sheet_mapping.py (96%) rename account_bank_statement_import_txt_xlsx/models/account_bank_statement_import_sheet_parser.py => account_statement_import_txt_xlsx/models/account_statement_import_sheet_parser.py (92%) rename {account_bank_statement_import_txt_xlsx => account_statement_import_txt_xlsx}/readme/CONFIGURE.rst (100%) rename {account_bank_statement_import_txt_xlsx => account_statement_import_txt_xlsx}/readme/CONTRIBUTORS.rst (100%) create mode 100644 account_statement_import_txt_xlsx/readme/DESCRIPTION.rst rename {account_bank_statement_import_txt_xlsx => account_statement_import_txt_xlsx}/readme/HISTORY.rst (100%) rename {account_bank_statement_import_txt_xlsx => account_statement_import_txt_xlsx}/readme/USAGE.rst (100%) create mode 100644 account_statement_import_txt_xlsx/security/ir.model.access.csv rename {account_bank_statement_import_txt_xlsx => account_statement_import_txt_xlsx}/static/description/icon.png (100%) rename {account_bank_statement_import_txt_xlsx => account_statement_import_txt_xlsx}/static/description/index.html (90%) rename {account_bank_statement_import_txt_xlsx => account_statement_import_txt_xlsx}/tests/__init__.py (53%) rename {account_bank_statement_import_txt_xlsx => account_statement_import_txt_xlsx}/tests/fixtures/balance.csv (100%) rename {account_bank_statement_import_txt_xlsx => account_statement_import_txt_xlsx}/tests/fixtures/debit_credit.csv (100%) rename {account_bank_statement_import_txt_xlsx => account_statement_import_txt_xlsx}/tests/fixtures/empty_statement_en.csv (100%) rename {account_bank_statement_import_txt_xlsx => account_statement_import_txt_xlsx}/tests/fixtures/empty_statement_en.xlsx (100%) rename {account_bank_statement_import_txt_xlsx => account_statement_import_txt_xlsx}/tests/fixtures/multi_currency.csv (100%) rename {account_bank_statement_import_txt_xlsx => account_statement_import_txt_xlsx}/tests/fixtures/original_currency.csv (100%) rename {account_bank_statement_import_txt_xlsx => account_statement_import_txt_xlsx}/tests/fixtures/original_currency_empty.csv (100%) create mode 100644 account_statement_import_txt_xlsx/tests/fixtures/sample_statement_en.csv create mode 100644 account_statement_import_txt_xlsx/tests/fixtures/sample_statement_en.xlsx rename account_bank_statement_import_txt_xlsx/tests/test_account_bank_statement_import_txt_xlsx.py => account_statement_import_txt_xlsx/tests/test_account_statement_import_txt_xlsx.py (70%) rename {account_bank_statement_import_txt_xlsx => account_statement_import_txt_xlsx}/views/account_journal_views.xml (100%) rename account_bank_statement_import_txt_xlsx/views/account_bank_statement_import.xml => account_statement_import_txt_xlsx/views/account_statement_import.xml (66%) rename account_bank_statement_import_txt_xlsx/views/account_bank_statement_import_sheet_mapping.xml => account_statement_import_txt_xlsx/views/account_statement_import_sheet_mapping.xml (85%) rename {account_bank_statement_import_txt_xlsx => account_statement_import_txt_xlsx}/wizards/__init__.py (50%) rename account_bank_statement_import_txt_xlsx/wizards/account_bank_statement_import_sheet_mapping_wizard.py => account_statement_import_txt_xlsx/wizards/account_statement_import_sheet_mapping_wizard.py (89%) rename account_bank_statement_import_txt_xlsx/wizards/account_bank_statement_import_sheet_mapping_wizard.xml => account_statement_import_txt_xlsx/wizards/account_statement_import_sheet_mapping_wizard.xml (90%) delete mode 120000 setup/account_bank_statement_import_txt_xlsx/odoo/addons/account_bank_statement_import_txt_xlsx create mode 120000 setup/account_statement_import_txt_xlsx/odoo/addons/account_statement_import_txt_xlsx rename setup/{account_bank_statement_import_txt_xlsx => account_statement_import_txt_xlsx}/setup.py (100%) diff --git a/account_bank_statement_import_txt_xlsx/models/__init__.py b/account_bank_statement_import_txt_xlsx/models/__init__.py deleted file mode 100644 index cddf714a..00000000 --- a/account_bank_statement_import_txt_xlsx/models/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). - -from . import account_bank_statement_import_sheet_mapping -from . import account_bank_statement_import_sheet_parser -from . import account_bank_statement_import -from . import account_journal diff --git a/account_bank_statement_import_txt_xlsx/readme/DESCRIPTION.rst b/account_bank_statement_import_txt_xlsx/readme/DESCRIPTION.rst deleted file mode 100644 index 25648404..00000000 --- a/account_bank_statement_import_txt_xlsx/readme/DESCRIPTION.rst +++ /dev/null @@ -1,2 +0,0 @@ -This module allows you to import the any TXT/CSV or XLSX file in Odoo as bank -statements. diff --git a/account_bank_statement_import_txt_xlsx/security/ir.model.access.csv b/account_bank_statement_import_txt_xlsx/security/ir.model.access.csv deleted file mode 100644 index 1e4598ba..00000000 --- a/account_bank_statement_import_txt_xlsx/security/ir.model.access.csv +++ /dev/null @@ -1,3 +0,0 @@ -"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" -access_account_bank_statement_import_sheet_mapping_manager,account.bank.statement.import.sheet.mapping:account.group_account_manager,model_account_bank_statement_import_sheet_mapping,account.group_account_manager,1,1,1,1 -access_account_bank_statement_import_sheet_mapping_user,account.bank.statement.import.sheet.mapping:account.group_account_user,model_account_bank_statement_import_sheet_mapping,account.group_account_user,1,0,0,0 diff --git a/account_bank_statement_import_txt_xlsx/tests/fixtures/sample_statement_en.csv b/account_bank_statement_import_txt_xlsx/tests/fixtures/sample_statement_en.csv deleted file mode 100644 index c50bfc83..00000000 --- a/account_bank_statement_import_txt_xlsx/tests/fixtures/sample_statement_en.csv +++ /dev/null @@ -1,3 +0,0 @@ -"Date","Label","Currency","Amount","Amount Currency","Partner Name","Bank Account" -"12/15/2018","Your best supplier","USD","-33.50","0.0","John Doe","123456789" -"12/15/2018","Your payment","EUR","1,525.00","1,000.00","Azure Interior","" diff --git a/account_bank_statement_import_txt_xlsx/tests/fixtures/sample_statement_en.xlsx b/account_bank_statement_import_txt_xlsx/tests/fixtures/sample_statement_en.xlsx deleted file mode 100644 index b3365b205d4ff97fe88181c5654983dcfec100d2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5092 zcmaJ_cQjmk*Ven3=)H@U7$Lgoy^cCcbfO!**C2Y0D~R4p^cFIcFhK~T_f8NDAp{{L z-?(?(FW#*8&7MEztXZ@7Ip_K9{p@FNkUAz7IT{`w9vX>bx;EMkqeWf&y8tab?OeQo zeh^P*YY4=d&)?OB@A{Y8G)?Ds{6tR=t|*kwdR1|45=CK&vh`Qr(ED`OM|*_Rr(1u9 z^3j|EyVn;F7IF1?e~rcvQM|nBz>(6xL|OwS zn+>N@1)4M;iyHG;!&4>9N(a=ms%8c{BlmTHgGZ_px#$QAy;@Vu7B^ndYcKfE2Adh; zTNWij1^oTQ_y|wNG{G_56zf%9paAYy*YnMXo6@Wdvuq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Ev%-elsbVZ_q4CmfFqyM@4PijQ+d;x zEL-Bq2b9(b`0c|5j~; zOCA4m%`G05?}k!rE$l0j!oXz_YzfMpq<**d3-TgTo~UUj3bDFJ635v2Vd2j_vx??% zI#kWPJML zZGWT0ljcwY^8_tpzdgzI^5|x!9?QU3C@k!!$0yNs`Vi)UzOXv{hrGmDk_{Y|EitB_ z=jPdRZ>{)f?jH2$aK|w9er32u-Km~DQ3!=P7$r|Z>gX8cXulRRHy0Au3z`44|Gl31 zJ*3-|2@i0Np&r@f7w@@|Bv#o z^#0xXW*fRzUB8SA|2GZxyX#G&zV1`M>^{+dbgkbVZ}QePkN+|?)Fb@P>c4y6EU0U4 u`(@s@Zg~I8bicdb%#7=*`(-q!XZbHR2vWyJ!H9;2kNQZXjwR*qoBkh+L5K|i diff --git a/account_bank_statement_import_txt_xlsx/README.rst b/account_statement_import_txt_xlsx/README.rst similarity index 84% rename from account_bank_statement_import_txt_xlsx/README.rst rename to account_statement_import_txt_xlsx/README.rst index e40f90e6..15e7b9ff 100644 --- a/account_bank_statement_import_txt_xlsx/README.rst +++ b/account_statement_import_txt_xlsx/README.rst @@ -1,6 +1,6 @@ -========================================== -Account Bank Statement Import TXT/CSV/XLSX -========================================== +================================== +Bank Statement TXT/CSV/XLSX Import +================================== .. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! @@ -14,18 +14,18 @@ Account Bank Statement Import TXT/CSV/XLSX :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fbank--statement--import-lightgray.png?logo=github - :target: https://github.com/OCA/bank-statement-import/tree/13.0/account_bank_statement_import_txt_xlsx + :target: https://github.com/OCA/bank-statement-import/tree/14.0/account_statement_import_txt_xlsx :alt: OCA/bank-statement-import .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/bank-statement-import-13-0/bank-statement-import-13-0-account_bank_statement_import_txt_xlsx + :target: https://translation.odoo-community.org/projects/bank-statement-import-14-0/bank-statement-import-14-0-account_statement_import_txt_xlsx :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/174/13.0 + :target: https://runbot.odoo-community.org/runbot/174/14.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| -This module allows you to import the any TXT/CSV or XLSX file in Odoo as bank +This module allows you to import any TXT/CSV or XLSX file in Odoo as bank statements. **Table of contents** @@ -66,7 +66,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -119,6 +119,6 @@ Current `maintainer `__: |maintainer-alexey-pelykh| -This module is part of the `OCA/bank-statement-import `_ project on GitHub. +This module is part of the `OCA/bank-statement-import `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_bank_statement_import_txt_xlsx/__init__.py b/account_statement_import_txt_xlsx/__init__.py similarity index 100% rename from account_bank_statement_import_txt_xlsx/__init__.py rename to account_statement_import_txt_xlsx/__init__.py diff --git a/account_bank_statement_import_txt_xlsx/__manifest__.py b/account_statement_import_txt_xlsx/__manifest__.py similarity index 70% rename from account_bank_statement_import_txt_xlsx/__manifest__.py rename to account_statement_import_txt_xlsx/__manifest__.py index 1e39a2ac..dbf2bd88 100644 --- a/account_bank_statement_import_txt_xlsx/__manifest__.py +++ b/account_statement_import_txt_xlsx/__manifest__.py @@ -3,9 +3,9 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). { - "name": "Account Bank Statement Import TXT/CSV/XLSX", + "name": "Bank Statement TXT/CSV/XLSX Import", "summary": "Import TXT/CSV or XLSX files as Bank Statements in Odoo", - "version": "13.0.1.0.4", + "version": "14.0.1.0.0", "category": "Accounting", "website": "https://github.com/OCA/bank-statement-import", "author": "ForgeFlow, CorporateHub, Odoo Community Association (OCA)", @@ -13,7 +13,7 @@ "license": "AGPL-3", "installable": True, "depends": [ - "account_bank_statement_import", + "account_statement_import", "multi_step_wizard", "web_widget_dropdown_dynamic", ], @@ -21,9 +21,9 @@ "data": [ "security/ir.model.access.csv", "data/map_data.xml", - "views/account_bank_statement_import_sheet_mapping.xml", - "views/account_bank_statement_import.xml", + "views/account_statement_import_sheet_mapping.xml", + "views/account_statement_import.xml", "views/account_journal_views.xml", - "wizards/account_bank_statement_import_sheet_mapping_wizard.xml", + "wizards/account_statement_import_sheet_mapping_wizard.xml", ], } diff --git a/account_bank_statement_import_txt_xlsx/data/map_data.xml b/account_statement_import_txt_xlsx/data/map_data.xml similarity index 89% rename from account_bank_statement_import_txt_xlsx/data/map_data.xml rename to account_statement_import_txt_xlsx/data/map_data.xml index 4f56e64e..f8746601 100644 --- a/account_bank_statement_import_txt_xlsx/data/map_data.xml +++ b/account_statement_import_txt_xlsx/data/map_data.xml @@ -5,10 +5,7 @@ License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> - + Sample Statement comma dot diff --git a/account_bank_statement_import_txt_xlsx/i18n/account_bank_statement_import_txt_xlsx.pot b/account_statement_import_txt_xlsx/i18n/account_bank_statement_import_txt_xlsx.pot similarity index 100% rename from account_bank_statement_import_txt_xlsx/i18n/account_bank_statement_import_txt_xlsx.pot rename to account_statement_import_txt_xlsx/i18n/account_bank_statement_import_txt_xlsx.pot diff --git a/account_bank_statement_import_txt_xlsx/i18n/nl.po b/account_statement_import_txt_xlsx/i18n/nl.po similarity index 100% rename from account_bank_statement_import_txt_xlsx/i18n/nl.po rename to account_statement_import_txt_xlsx/i18n/nl.po diff --git a/account_bank_statement_import_txt_xlsx/i18n/zh_CN.po b/account_statement_import_txt_xlsx/i18n/zh_CN.po similarity index 100% rename from account_bank_statement_import_txt_xlsx/i18n/zh_CN.po rename to account_statement_import_txt_xlsx/i18n/zh_CN.po diff --git a/account_statement_import_txt_xlsx/models/__init__.py b/account_statement_import_txt_xlsx/models/__init__.py new file mode 100644 index 00000000..af86f7c7 --- /dev/null +++ b/account_statement_import_txt_xlsx/models/__init__.py @@ -0,0 +1,6 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import account_statement_import_sheet_mapping +from . import account_statement_import_sheet_parser +from . import account_statement_import +from . import account_journal diff --git a/account_bank_statement_import_txt_xlsx/models/account_journal.py b/account_statement_import_txt_xlsx/models/account_journal.py similarity index 88% rename from account_bank_statement_import_txt_xlsx/models/account_journal.py rename to account_statement_import_txt_xlsx/models/account_journal.py index a2e49d22..b6c3f86c 100644 --- a/account_bank_statement_import_txt_xlsx/models/account_journal.py +++ b/account_statement_import_txt_xlsx/models/account_journal.py @@ -9,7 +9,7 @@ class AccountJournal(models.Model): _inherit = "account.journal" default_sheet_mapping_id = fields.Many2one( - comodel_name="account.bank.statement.import.sheet.mapping", + comodel_name="account.statement.import.sheet.mapping", ) def _get_bank_statements_available_import_formats(self): diff --git a/account_bank_statement_import_txt_xlsx/models/account_bank_statement_import.py b/account_statement_import_txt_xlsx/models/account_statement_import.py similarity index 71% rename from account_bank_statement_import_txt_xlsx/models/account_bank_statement_import.py rename to account_statement_import_txt_xlsx/models/account_statement_import.py index 19df908e..be961fb1 100644 --- a/account_bank_statement_import_txt_xlsx/models/account_bank_statement_import.py +++ b/account_statement_import_txt_xlsx/models/account_statement_import.py @@ -8,8 +8,8 @@ from odoo import fields, models _logger = logging.getLogger(__name__) -class AccountBankStatementImport(models.TransientModel): - _inherit = "account.bank.statement.import" +class AccountStatementImport(models.TransientModel): + _inherit = "account.statement.import" def _get_default_mapping_id(self): return ( @@ -20,17 +20,17 @@ class AccountBankStatementImport(models.TransientModel): sheet_mapping_id = fields.Many2one( string="Sheet mapping", - comodel_name="account.bank.statement.import.sheet.mapping", + comodel_name="account.statement.import.sheet.mapping", default=_get_default_mapping_id, ) def _parse_file(self, data_file): self.ensure_one() try: - Parser = self.env["account.bank.statement.import.sheet.parser"] + Parser = self.env["account.statement.import.sheet.parser"] return Parser.parse(data_file, self.sheet_mapping_id) except BaseException: - if self.env.context.get("account_bank_statement_import_txt_xlsx_test"): + if self.env.context.get("account_statement_import_txt_xlsx_test"): raise _logger.warning("Sheet parser error", exc_info=True) return super()._parse_file(data_file) diff --git a/account_bank_statement_import_txt_xlsx/models/account_bank_statement_import_sheet_mapping.py b/account_statement_import_txt_xlsx/models/account_statement_import_sheet_mapping.py similarity index 96% rename from account_bank_statement_import_txt_xlsx/models/account_bank_statement_import_sheet_mapping.py rename to account_statement_import_txt_xlsx/models/account_statement_import_sheet_mapping.py index bec696c3..4d7e7b57 100644 --- a/account_bank_statement_import_txt_xlsx/models/account_bank_statement_import_sheet_mapping.py +++ b/account_statement_import_txt_xlsx/models/account_statement_import_sheet_mapping.py @@ -5,9 +5,9 @@ from odoo import api, fields, models -class AccountBankStatementImportSheetMapping(models.Model): - _name = "account.bank.statement.import.sheet.mapping" - _description = "Account Bank Statement Import Sheet Mapping" +class AccountStatementImportSheetMapping(models.Model): + _name = "account.statement.import.sheet.mapping" + _description = "Bank Statement Import Sheet Mapping" name = fields.Char( required=True, diff --git a/account_bank_statement_import_txt_xlsx/models/account_bank_statement_import_sheet_parser.py b/account_statement_import_txt_xlsx/models/account_statement_import_sheet_parser.py similarity index 92% rename from account_bank_statement_import_txt_xlsx/models/account_bank_statement_import_sheet_parser.py rename to account_statement_import_txt_xlsx/models/account_statement_import_sheet_parser.py index c92c9168..460bfe56 100644 --- a/account_bank_statement_import_txt_xlsx/models/account_bank_statement_import_sheet_parser.py +++ b/account_statement_import_txt_xlsx/models/account_statement_import_sheet_parser.py @@ -21,9 +21,9 @@ except (ImportError, IOError) as err: # pragma: no cover _logger.error(err) -class AccountBankStatementImportSheetParser(models.TransientModel): - _name = "account.bank.statement.import.sheet.parser" - _description = "Account Bank Statement Import Sheet Parser" +class AccountStatementImportSheetParser(models.TransientModel): + _name = "account.statement.import.sheet.parser" + _description = "Bank Statement Import Sheet Parser" @api.model def parse_header(self, data_file, encoding, csv_options): @@ -263,12 +263,6 @@ class AccountBankStatementImportSheetParser(models.TransientModel): if debit_credit == mapping.debit_value: amount = -amount - if not original_currency: - original_currency = currency - original_amount = amount - elif original_currency == currency: - original_amount = amount - if original_amount: original_amount = self._parse_decimal( original_amount, mapping @@ -303,7 +297,7 @@ class AccountBankStatementImportSheetParser(models.TransientModel): return lines @api.model - def _convert_line_to_transactions(self, line): + def _convert_line_to_transactions(self, line): # noqa: C901 """Hook for extension""" timestamp = line["timestamp"] amount = line["amount"] @@ -322,18 +316,30 @@ class AccountBankStatementImportSheetParser(models.TransientModel): "date": timestamp, "amount": str(amount), } - if currency != original_currency: + + if original_currency == currency: + original_currency = None + if not amount: + amount = original_amount + original_amount = "0.0" + + if original_currency: original_currency = self.env["res.currency"].search( [("name", "=", original_currency)], limit=1, ) if original_currency: - transaction.update( - { - "amount_currency": str(original_amount), - "currency_id": original_currency.id, - } - ) + transaction["foreign_currency_id"] = original_currency.id + if original_amount: + transaction["amount_currency"] = str(original_amount) + + if currency: + currency = self.env["res.currency"].search( + [("name", "=", currency)], + limit=1, + ) + if currency: + transaction["currency_id"] = currency.id if transaction_id: transaction["unique_import_id"] = "{}-{}".format( @@ -341,7 +347,7 @@ class AccountBankStatementImportSheetParser(models.TransientModel): int(timestamp.timestamp()), ) - transaction["name"] = description or _("N/A") + transaction["payment_ref"] = description or _("N/A") if reference: transaction["ref"] = reference @@ -357,7 +363,7 @@ class AccountBankStatementImportSheetParser(models.TransientModel): elif note: note = note.strip() if note: - transaction["note"] = note + transaction["narration"] = note if partner_name: transaction["partner_name"] = partner_name diff --git a/account_bank_statement_import_txt_xlsx/readme/CONFIGURE.rst b/account_statement_import_txt_xlsx/readme/CONFIGURE.rst similarity index 100% rename from account_bank_statement_import_txt_xlsx/readme/CONFIGURE.rst rename to account_statement_import_txt_xlsx/readme/CONFIGURE.rst diff --git a/account_bank_statement_import_txt_xlsx/readme/CONTRIBUTORS.rst b/account_statement_import_txt_xlsx/readme/CONTRIBUTORS.rst similarity index 100% rename from account_bank_statement_import_txt_xlsx/readme/CONTRIBUTORS.rst rename to account_statement_import_txt_xlsx/readme/CONTRIBUTORS.rst diff --git a/account_statement_import_txt_xlsx/readme/DESCRIPTION.rst b/account_statement_import_txt_xlsx/readme/DESCRIPTION.rst new file mode 100644 index 00000000..1862d60f --- /dev/null +++ b/account_statement_import_txt_xlsx/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +This module allows you to import any TXT/CSV or XLSX file in Odoo as bank +statements. diff --git a/account_bank_statement_import_txt_xlsx/readme/HISTORY.rst b/account_statement_import_txt_xlsx/readme/HISTORY.rst similarity index 100% rename from account_bank_statement_import_txt_xlsx/readme/HISTORY.rst rename to account_statement_import_txt_xlsx/readme/HISTORY.rst diff --git a/account_bank_statement_import_txt_xlsx/readme/USAGE.rst b/account_statement_import_txt_xlsx/readme/USAGE.rst similarity index 100% rename from account_bank_statement_import_txt_xlsx/readme/USAGE.rst rename to account_statement_import_txt_xlsx/readme/USAGE.rst diff --git a/account_statement_import_txt_xlsx/security/ir.model.access.csv b/account_statement_import_txt_xlsx/security/ir.model.access.csv new file mode 100644 index 00000000..aa8c3d95 --- /dev/null +++ b/account_statement_import_txt_xlsx/security/ir.model.access.csv @@ -0,0 +1,5 @@ +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" +access_account_statement_import_sheet_mapping_manager,account.statement.import.sheet.mapping:account.group_account_manager,model_account_statement_import_sheet_mapping,account.group_account_manager,1,1,1,1 +access_account_statement_import_sheet_mapping_user,account.statement.import.sheet.mapping:account.group_account_user,model_account_statement_import_sheet_mapping,account.group_account_user,1,0,0,0 +access_account_statement_import_sheet_parser,account.statement.import.sheet.parser:account.group_account_user,model_account_statement_import_sheet_parser,account.group_account_user,1,1,1,1 +access_account_statement_import_sheet_mapping_wizard,Full access on account.statement.import.sheet.mapping.wizard,model_account_statement_import_sheet_mapping_wizard,account.group_account_user,1,1,1,1 diff --git a/account_bank_statement_import_txt_xlsx/static/description/icon.png b/account_statement_import_txt_xlsx/static/description/icon.png similarity index 100% rename from account_bank_statement_import_txt_xlsx/static/description/icon.png rename to account_statement_import_txt_xlsx/static/description/icon.png diff --git a/account_bank_statement_import_txt_xlsx/static/description/index.html b/account_statement_import_txt_xlsx/static/description/index.html similarity index 90% rename from account_bank_statement_import_txt_xlsx/static/description/index.html rename to account_statement_import_txt_xlsx/static/description/index.html index c2fb1d37..88ea98fa 100644 --- a/account_bank_statement_import_txt_xlsx/static/description/index.html +++ b/account_statement_import_txt_xlsx/static/description/index.html @@ -4,7 +4,7 @@ -Account Bank Statement Import TXT/CSV/XLSX +Bank Statement TXT/CSV/XLSX Import -
-

Account Bank Statement Import TXT/CSV/XLSX

+
+

Bank Statement TXT/CSV/XLSX Import

-

Beta License: AGPL-3 OCA/bank-statement-import Translate me on Weblate Try me on Runbot

-

This module allows you to import the any TXT/CSV or XLSX file in Odoo as bank +

Beta License: AGPL-3 OCA/bank-statement-import Translate me on Weblate Try me on Runbot

+

This module allows you to import any TXT/CSV or XLSX file in Odoo as bank statements.

Table of contents

@@ -421,7 +421,7 @@ statements.

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -463,7 +463,7 @@ mission is to support the collaborative development of Odoo features and promote its widespread use.

Current maintainer:

alexey-pelykh

-

This module is part of the OCA/bank-statement-import project on GitHub.

+

This module is part of the OCA/bank-statement-import project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

diff --git a/account_bank_statement_import_txt_xlsx/tests/__init__.py b/account_statement_import_txt_xlsx/tests/__init__.py similarity index 53% rename from account_bank_statement_import_txt_xlsx/tests/__init__.py rename to account_statement_import_txt_xlsx/tests/__init__.py index 3073e38a..426d6838 100644 --- a/account_bank_statement_import_txt_xlsx/tests/__init__.py +++ b/account_statement_import_txt_xlsx/tests/__init__.py @@ -1,3 +1,3 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -from . import test_account_bank_statement_import_txt_xlsx +from . import test_account_statement_import_txt_xlsx diff --git a/account_bank_statement_import_txt_xlsx/tests/fixtures/balance.csv b/account_statement_import_txt_xlsx/tests/fixtures/balance.csv similarity index 100% rename from account_bank_statement_import_txt_xlsx/tests/fixtures/balance.csv rename to account_statement_import_txt_xlsx/tests/fixtures/balance.csv diff --git a/account_bank_statement_import_txt_xlsx/tests/fixtures/debit_credit.csv b/account_statement_import_txt_xlsx/tests/fixtures/debit_credit.csv similarity index 100% rename from account_bank_statement_import_txt_xlsx/tests/fixtures/debit_credit.csv rename to account_statement_import_txt_xlsx/tests/fixtures/debit_credit.csv diff --git a/account_bank_statement_import_txt_xlsx/tests/fixtures/empty_statement_en.csv b/account_statement_import_txt_xlsx/tests/fixtures/empty_statement_en.csv similarity index 100% rename from account_bank_statement_import_txt_xlsx/tests/fixtures/empty_statement_en.csv rename to account_statement_import_txt_xlsx/tests/fixtures/empty_statement_en.csv diff --git a/account_bank_statement_import_txt_xlsx/tests/fixtures/empty_statement_en.xlsx b/account_statement_import_txt_xlsx/tests/fixtures/empty_statement_en.xlsx similarity index 100% rename from account_bank_statement_import_txt_xlsx/tests/fixtures/empty_statement_en.xlsx rename to account_statement_import_txt_xlsx/tests/fixtures/empty_statement_en.xlsx diff --git a/account_bank_statement_import_txt_xlsx/tests/fixtures/multi_currency.csv b/account_statement_import_txt_xlsx/tests/fixtures/multi_currency.csv similarity index 100% rename from account_bank_statement_import_txt_xlsx/tests/fixtures/multi_currency.csv rename to account_statement_import_txt_xlsx/tests/fixtures/multi_currency.csv diff --git a/account_bank_statement_import_txt_xlsx/tests/fixtures/original_currency.csv b/account_statement_import_txt_xlsx/tests/fixtures/original_currency.csv similarity index 100% rename from account_bank_statement_import_txt_xlsx/tests/fixtures/original_currency.csv rename to account_statement_import_txt_xlsx/tests/fixtures/original_currency.csv diff --git a/account_bank_statement_import_txt_xlsx/tests/fixtures/original_currency_empty.csv b/account_statement_import_txt_xlsx/tests/fixtures/original_currency_empty.csv similarity index 100% rename from account_bank_statement_import_txt_xlsx/tests/fixtures/original_currency_empty.csv rename to account_statement_import_txt_xlsx/tests/fixtures/original_currency_empty.csv diff --git a/account_statement_import_txt_xlsx/tests/fixtures/sample_statement_en.csv b/account_statement_import_txt_xlsx/tests/fixtures/sample_statement_en.csv new file mode 100644 index 00000000..dc214d70 --- /dev/null +++ b/account_statement_import_txt_xlsx/tests/fixtures/sample_statement_en.csv @@ -0,0 +1,3 @@ +"Date","Label","Currency","Amount","Amount Currency","Partner Name","Bank Account" +"12/15/2018","Your best supplier on 12/15/2018","USD","-33.50","0.0","John Doe","123456789" +"12/15/2018","Your payment on 12/15/2018","EUR","1,525.00","1,000.00","Azure Interior","" diff --git a/account_statement_import_txt_xlsx/tests/fixtures/sample_statement_en.xlsx b/account_statement_import_txt_xlsx/tests/fixtures/sample_statement_en.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..6f431a62139853e25d02cab975533a4d3e4e4a16 GIT binary patch literal 5101 zcmaJ_byQS)*QUcEMj0BUrIaBAY3c4R>8^pHq+5^%=@1wiNoffI0qGWGkPeAKN<@(O zhI`lj3N3aRh%Fzw% z1%W!4Lm&Vy!!GdYM=V*cn@FFOv7~m z2c_X1E5!J#@!8`Jxs#p8u{)7Hl6Y9yAy<-6%Ht{>(5~9h$4b=Y{*p#QOfe4*-HY zU#S*=xL`a!YRZtVtX^F3LsL`4#!)>u^O;1xHxn8PirW7~2J|;FZnkDnD@#pxsGYNo z+YK-&uf$c+xPamNS5d`YtkFSoo@unUFs>J+RKlrNmXu9Xf>ZYnXAOn7Mv^V&A)6yv zX{mLp^Djk!lo2Tpef(KbD4Tej->jc+{P3g4#Evyw5C~JaAGA>+%AOG_SJa>4D0!e+ z)NI#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*5)9e%=%DiCZq&YW$ zlKkFeezY9cyl7%8#nC27!w@ z65XOtpiYxU2QaZmLzaAb0$-A_E?fdVwXT8&mqP4WF|1ubaZ%%^x9w$My^F(klnos9 zjFqm)eJ<EZ|EL6CuSQ}i%ewZ+@hmz2p!DG@vnLsx&9p@0u!scu!KjaEHYr8 zw!5lhQkvR%6e_KbV6QV@6&#is!`kIY*PLdpx|sC$9>OgV(4414U&E@d+yt6&Wa6*d zl9acHY(I5QFxx&wjtJN|*5x5h%gEOj`qz;Gi2R2o#6k@Uad88ixwzaY*_;GbRpbcO zyYCmp25(R{)yybE z>r5%bcED!4c1rENo4d^tkS;&ih&W`7T7b3>zeu0DbKnbT zp40|!K>i{3o*kKN!7^*M^k+*)LRw@71WM$NbOQpZ0bWwPBN1 zN&&Nt2SxMh+g)kl+S|FrfsqpwOtn(7wYW76b$H)aYs?65vsqiEOC$pRydlT~4cdjoz33Ibj%Zn1U!`G{(lOUB%|(+sGfL zIpyC$6R6^MZPn$Aj#&+=HxJ3AN8KKItJ|f+i1;55ebX>YFMZhdc`)eYju9xP-lAJ+ zV#fCar>8l9$tyH(Jot-N zV!l9A7+*9K%=-yDF;(ANtOx??kI+154)&l0?(QqeBGv@oLzNYcD)`PLY;f}w?H1o!& zSV!bB&Hrms6CsbvP!i(oZsqK5qUG&k<@W5a2`#xxBYX35-UpKjVBM7JfN53aq zDkZ>R0ik4n>9m)bbS1Kztb-<{DBU}t(8dFK(5NwbUNtfkWZC|vr;scfFZ)N|J8h=d zBwl9?>B_Pj=0ri2W zZpjf0tq<$}xO(4TD-==}aK|`WMc)e{yjmPyN7G~K6WP`tcyLwRSvN1Zi-ruRGbO@Y`~gJO7*sOuutshT1x8VKe0X6E*0 z;$}1RpZ34^G=IjqJ%HcrF@75b^3FHv<*< E1Br`?4gdfE literal 0 HcmV?d00001 diff --git a/account_bank_statement_import_txt_xlsx/tests/test_account_bank_statement_import_txt_xlsx.py b/account_statement_import_txt_xlsx/tests/test_account_statement_import_txt_xlsx.py similarity index 70% rename from account_bank_statement_import_txt_xlsx/tests/test_account_bank_statement_import_txt_xlsx.py rename to account_statement_import_txt_xlsx/tests/test_account_statement_import_txt_xlsx.py index fe009b06..9236b16f 100644 --- a/account_bank_statement_import_txt_xlsx/tests/test_account_bank_statement_import_txt_xlsx.py +++ b/account_statement_import_txt_xlsx/tests/test_account_statement_import_txt_xlsx.py @@ -18,16 +18,16 @@ class TestAccountBankStatementImportTxtXlsx(common.TransactionCase): self.currency_eur = self.env.ref("base.EUR") self.currency_usd = self.env.ref("base.USD") self.sample_statement_map = self.env.ref( - "account_bank_statement_import_txt_xlsx.sample_statement_map" + "account_statement_import_txt_xlsx.sample_statement_map" ) self.AccountJournal = self.env["account.journal"] self.AccountBankStatement = self.env["account.bank.statement"] - self.AccountBankStatementImport = self.env["account.bank.statement.import"] - self.AccountBankStatementImportSheetMapping = self.env[ - "account.bank.statement.import.sheet.mapping" + self.AccountStatementImport = self.env["account.statement.import"] + self.AccountStatementImportSheetMapping = self.env[ + "account.statement.import.sheet.mapping" ] - self.AccountBankStatementImportSheetMappingWizard = self.env[ - "account.bank.statement.import.sheet.mapping.wizard" + self.AccountStatementImportSheetMappingWizard = self.env[ + "account.statement.import.sheet.mapping.wizard" ] def _data_file(self, filename, encoding=None): @@ -48,19 +48,16 @@ class TestAccountBankStatementImportTxtXlsx(common.TransactionCase): } ) data = self._data_file("fixtures/sample_statement_en.csv", "utf-8") - wizard = self.AccountBankStatementImport.with_context( - journal_id=journal.id - ).create( + wizard = self.AccountStatementImport.with_context(journal_id=journal.id).create( { - "attachment_ids": [ - (0, 0, {"name": "fixtures/sample_statement_en.csv", "datas": data}) - ], + "statement_filename": "fixtures/sample_statement_en.csv", + "statement_file": data, "sheet_mapping_id": self.sample_statement_map.id, } ) wizard.with_context( - account_bank_statement_import_txt_xlsx_test=True - ).import_file() + account_statement_import_txt_xlsx_test=True + ).import_file_button() statement = self.AccountBankStatement.search([("journal_id", "=", journal.id)]) self.assertEqual(len(statement), 1) self.assertEqual(len(statement.line_ids), 2) @@ -75,20 +72,17 @@ class TestAccountBankStatementImportTxtXlsx(common.TransactionCase): } ) data = self._data_file("fixtures/empty_statement_en.csv", "utf-8") - wizard = self.AccountBankStatementImport.with_context( - journal_id=journal.id - ).create( + wizard = self.AccountStatementImport.with_context(journal_id=journal.id).create( { - "attachment_ids": [ - (0, 0, {"name": "fixtures/empty_statement_en.csv", "datas": data}) - ], + "statement_filename": "fixtures/empty_statement_en.csv", + "statement_file": data, "sheet_mapping_id": self.sample_statement_map.id, } ) with self.assertRaises(UserError): wizard.with_context( - account_bank_statement_import_txt_xlsx_test=True - ).import_file() + account_statement_import_txt_xlsx_test=True + ).import_file_button() statement = self.AccountBankStatement.search([("journal_id", "=", journal.id)]) self.assertEqual(len(statement), 0) @@ -102,19 +96,16 @@ class TestAccountBankStatementImportTxtXlsx(common.TransactionCase): } ) data = self._data_file("fixtures/sample_statement_en.xlsx") - wizard = self.AccountBankStatementImport.with_context( - journal_id=journal.id - ).create( + wizard = self.AccountStatementImport.with_context(journal_id=journal.id).create( { - "attachment_ids": [ - (0, 0, {"name": "fixtures/sample_statement_en.xlsx", "datas": data}) - ], + "statement_filename": "fixtures/sample_statement_en.xlsx", + "statement_file": data, "sheet_mapping_id": self.sample_statement_map.id, } ) wizard.with_context( - account_bank_statement_import_txt_xlsx_test=True - ).import_file() + account_statement_import_txt_xlsx_test=True + ).import_file_button() statement = self.AccountBankStatement.search([("journal_id", "=", journal.id)]) self.assertEqual(len(statement), 1) self.assertEqual(len(statement.line_ids), 2) @@ -129,25 +120,22 @@ class TestAccountBankStatementImportTxtXlsx(common.TransactionCase): } ) data = self._data_file("fixtures/empty_statement_en.xlsx") - wizard = self.AccountBankStatementImport.with_context( - journal_id=journal.id - ).create( + wizard = self.AccountStatementImport.with_context(journal_id=journal.id).create( { - "attachment_ids": [ - (0, 0, {"name": "fixtures/empty_statement_en.xlsx", "datas": data}) - ], + "statement_filename": "fixtures/empty_statement_en.xlsx", + "statement_file": data, "sheet_mapping_id": self.sample_statement_map.id, } ) with self.assertRaises(UserError): wizard.with_context( - account_bank_statement_import_txt_xlsx_test=True - ).import_file() + account_statement_import_txt_xlsx_test=True + ).import_file_button() statement = self.AccountBankStatement.search([("journal_id", "=", journal.id)]) self.assertEqual(len(statement), 0) def test_mapping_import_wizard_xlsx(self): - with common.Form(self.AccountBankStatementImportSheetMappingWizard) as form: + with common.Form(self.AccountStatementImportSheetMappingWizard) as form: attachment = self.env["ir.attachment"].create( { "name": "fixtures/empty_statement_en.xlsx", @@ -158,7 +146,7 @@ class TestAccountBankStatementImportTxtXlsx(common.TransactionCase): self.assertEqual(len(form.header), 90) self.assertEqual( len( - self.AccountBankStatementImportSheetMappingWizard.with_context( + self.AccountStatementImportSheetMappingWizard.with_context( header=form.header, ).statement_columns() ), @@ -170,7 +158,7 @@ class TestAccountBankStatementImportTxtXlsx(common.TransactionCase): wizard.import_mapping() def test_mapping_import_wizard_csv(self): - with common.Form(self.AccountBankStatementImportSheetMappingWizard) as form: + with common.Form(self.AccountStatementImportSheetMappingWizard) as form: attachment = self.env["ir.attachment"].create( { "name": "fixtures/empty_statement_en.csv", @@ -181,7 +169,7 @@ class TestAccountBankStatementImportTxtXlsx(common.TransactionCase): self.assertEqual(len(form.header), 90) self.assertEqual( len( - self.AccountBankStatementImportSheetMappingWizard.with_context( + self.AccountStatementImportSheetMappingWizard.with_context( header=form.header, ).statement_columns() ), @@ -202,25 +190,24 @@ class TestAccountBankStatementImportTxtXlsx(common.TransactionCase): } ) data = self._data_file("fixtures/original_currency.csv", "utf-8") - wizard = self.AccountBankStatementImport.with_context( - journal_id=journal.id - ).create( + wizard = self.AccountStatementImport.with_context(journal_id=journal.id).create( { - "attachment_ids": [ - (0, 0, {"name": "fixtures/original_currency.csv", "datas": data}) - ], + "statement_filename": "fixtures/original_currency.csv", + "statement_file": data, "sheet_mapping_id": self.sample_statement_map.id, } ) wizard.with_context( - account_bank_statement_import_txt_xlsx_test=True - ).import_file() + account_statement_import_txt_xlsx_test=True + ).import_file_button() statement = self.AccountBankStatement.search([("journal_id", "=", journal.id)]) self.assertEqual(len(statement), 1) self.assertEqual(len(statement.line_ids), 1) line = statement.line_ids - self.assertEqual(line.currency_id, self.currency_eur) + self.assertEqual(line.currency_id, self.currency_usd) + self.assertEqual(line.amount, 1525.0) + self.assertEqual(line.foreign_currency_id, self.currency_eur) self.assertEqual(line.amount_currency, 1000.0) def test_original_currency_empty(self): @@ -233,29 +220,22 @@ class TestAccountBankStatementImportTxtXlsx(common.TransactionCase): } ) data = self._data_file("fixtures/original_currency_empty.csv", "utf-8") - wizard = self.AccountBankStatementImport.with_context( - journal_id=journal.id - ).create( + wizard = self.AccountStatementImport.with_context(journal_id=journal.id).create( { - "attachment_ids": [ - ( - 0, - 0, - {"name": "fixtures/original_currency_empty.csv", "datas": data}, - ) - ], + "statement_filename": "fixtures/original_currency_empty.csv", + "statement_file": data, "sheet_mapping_id": self.sample_statement_map.id, } ) wizard.with_context( - account_bank_statement_import_txt_xlsx_test=True - ).import_file() + account_statement_import_txt_xlsx_test=True + ).import_file_button() statement = self.AccountBankStatement.search([("journal_id", "=", journal.id)]) self.assertEqual(len(statement), 1) self.assertEqual(len(statement.line_ids), 1) line = statement.line_ids - self.assertFalse(line.currency_id) + self.assertFalse(line.foreign_currency_id) self.assertEqual(line.amount_currency, 0.0) def test_multi_currency(self): @@ -275,25 +255,22 @@ class TestAccountBankStatementImportTxtXlsx(common.TransactionCase): } ) data = self._data_file("fixtures/multi_currency.csv", "utf-8") - wizard = self.AccountBankStatementImport.with_context( - journal_id=journal.id - ).create( + wizard = self.AccountStatementImport.with_context(journal_id=journal.id).create( { - "attachment_ids": [ - (0, 0, {"name": "fixtures/multi_currency.csv", "datas": data}) - ], + "statement_filename": "fixtures/multi_currency.csv", + "statement_file": data, "sheet_mapping_id": statement_map.id, } ) wizard.with_context( - account_bank_statement_import_txt_xlsx_test=True - ).import_file() + account_statement_import_txt_xlsx_test=True + ).import_file_button() statement = self.AccountBankStatement.search([("journal_id", "=", journal.id)]) self.assertEqual(len(statement), 1) self.assertEqual(len(statement.line_ids), 1) line = statement.line_ids - self.assertFalse(line.currency_id) + self.assertFalse(line.foreign_currency_id) self.assertEqual(line.amount, -33.5) def test_balance(self): @@ -313,19 +290,16 @@ class TestAccountBankStatementImportTxtXlsx(common.TransactionCase): } ) data = self._data_file("fixtures/balance.csv", "utf-8") - wizard = self.AccountBankStatementImport.with_context( - journal_id=journal.id - ).create( + wizard = self.AccountStatementImport.with_context(journal_id=journal.id).create( { - "attachment_ids": [ - (0, 0, {"name": "fixtures/balance.csv", "datas": data}) - ], + "statement_filename": "fixtures/balance.csv", + "statement_file": data, "sheet_mapping_id": statement_map.id, } ) wizard.with_context( - account_bank_statement_import_txt_xlsx_test=True - ).import_file() + account_statement_import_txt_xlsx_test=True + ).import_file_button() statement = self.AccountBankStatement.search([("journal_id", "=", journal.id)]) self.assertEqual(len(statement), 1) self.assertEqual(len(statement.line_ids), 2) @@ -353,19 +327,16 @@ class TestAccountBankStatementImportTxtXlsx(common.TransactionCase): } ) data = self._data_file("fixtures/debit_credit.csv", "utf-8") - wizard = self.AccountBankStatementImport.with_context( - journal_id=journal.id - ).create( + wizard = self.AccountStatementImport.with_context(journal_id=journal.id).create( { - "attachment_ids": [ - (0, 0, {"name": "fixtures/debit_credit.csv", "datas": data}) - ], + "statement_filename": "fixtures/debit_credit.csv", + "statement_file": data, "sheet_mapping_id": statement_map.id, } ) wizard.with_context( - account_bank_statement_import_txt_xlsx_test=True - ).import_file() + account_statement_import_txt_xlsx_test=True + ).import_file_button() statement = self.AccountBankStatement.search([("journal_id", "=", journal.id)]) self.assertEqual(len(statement), 1) self.assertEqual(len(statement.line_ids), 2) diff --git a/account_bank_statement_import_txt_xlsx/views/account_journal_views.xml b/account_statement_import_txt_xlsx/views/account_journal_views.xml similarity index 100% rename from account_bank_statement_import_txt_xlsx/views/account_journal_views.xml rename to account_statement_import_txt_xlsx/views/account_journal_views.xml diff --git a/account_bank_statement_import_txt_xlsx/views/account_bank_statement_import.xml b/account_statement_import_txt_xlsx/views/account_statement_import.xml similarity index 66% rename from account_bank_statement_import_txt_xlsx/views/account_bank_statement_import.xml rename to account_statement_import_txt_xlsx/views/account_statement_import.xml index 65d0cd1a..4ef359aa 100644 --- a/account_bank_statement_import_txt_xlsx/views/account_bank_statement_import.xml +++ b/account_statement_import_txt_xlsx/views/account_statement_import.xml @@ -5,12 +5,12 @@ License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> - - account.bank.statement.import - account.bank.statement.import + + account.statement.import + account.statement.import diff --git a/account_bank_statement_import_txt_xlsx/views/account_bank_statement_import_sheet_mapping.xml b/account_statement_import_txt_xlsx/views/account_statement_import_sheet_mapping.xml similarity index 85% rename from account_bank_statement_import_txt_xlsx/views/account_bank_statement_import_sheet_mapping.xml rename to account_statement_import_txt_xlsx/views/account_statement_import_sheet_mapping.xml index 5caa5b12..8f9718b5 100644 --- a/account_bank_statement_import_txt_xlsx/views/account_bank_statement_import_sheet_mapping.xml +++ b/account_statement_import_txt_xlsx/views/account_statement_import_sheet_mapping.xml @@ -5,18 +5,18 @@ License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> - - account.bank.statement.import.sheet.mapping.form - account.bank.statement.import.sheet.mapping + + account.statement.import.sheet.mapping.form + account.statement.import.sheet.mapping - - account.bank.statement.import.sheet.mapping.tree - account.bank.statement.import.sheet.mapping + + account.statement.import.sheet.mapping.tree + account.statement.import.sheet.mapping
@@ -77,7 +77,7 @@ model="ir.actions.act_window" > Statement Sheet Mappings - account.bank.statement.import.sheet.mapping + account.statement.import.sheet.mapping tree,form - - account.bank.statement.import.sheet.mapping.wizard.form - account.bank.statement.import.sheet.mapping.wizard + + account.statement.import.sheet.mapping.wizard.form + account.statement.import.sheet.mapping.wizard primary @@ -151,12 +146,17 @@ - + + Import Mapping + account.statement.import.sheet.mapping.wizard + + form + new + diff --git a/setup/account_bank_statement_import_txt_xlsx/odoo/addons/account_bank_statement_import_txt_xlsx b/setup/account_bank_statement_import_txt_xlsx/odoo/addons/account_bank_statement_import_txt_xlsx deleted file mode 120000 index 38905400..00000000 --- a/setup/account_bank_statement_import_txt_xlsx/odoo/addons/account_bank_statement_import_txt_xlsx +++ /dev/null @@ -1 +0,0 @@ -../../../../account_bank_statement_import_txt_xlsx \ No newline at end of file diff --git a/setup/account_statement_import_txt_xlsx/odoo/addons/account_statement_import_txt_xlsx b/setup/account_statement_import_txt_xlsx/odoo/addons/account_statement_import_txt_xlsx new file mode 120000 index 00000000..036eee8c --- /dev/null +++ b/setup/account_statement_import_txt_xlsx/odoo/addons/account_statement_import_txt_xlsx @@ -0,0 +1 @@ +../../../../account_statement_import_txt_xlsx \ No newline at end of file diff --git a/setup/account_bank_statement_import_txt_xlsx/setup.py b/setup/account_statement_import_txt_xlsx/setup.py similarity index 100% rename from setup/account_bank_statement_import_txt_xlsx/setup.py rename to setup/account_statement_import_txt_xlsx/setup.py