diff --git a/account_statement_import_ofx/README.rst b/account_statement_import_ofx/README.rst new file mode 100644 index 00000000..2d7875d0 --- /dev/null +++ b/account_statement_import_ofx/README.rst @@ -0,0 +1,109 @@ +========================= +Import OFX Bank Statement +========================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:1716bd49010fb3f50b7f5ffc4ade620361a09a4b341089d3dc456197bf779819 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png + :target: https://odoo-community.org/page/development-status + :alt: Mature +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :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/17.0/account_statement_import_ofx + :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-17-0/bank-statement-import-17-0-account_statement_import_ofx + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/bank-statement-import&target_branch=17.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module adds support for the import of bank statements in `OFX +format `__. + +Bank Statements may be generated containing a subset of the OFX +information (only those transaction lines that are required for the +creation of the Financial Accounting records). + +Since v14, this module support multi-account OFX files i.e. several +different bank accounts in the same OFX file. + +**Table of contents** + +.. contents:: + :local: + +Installation +============ + +This module requires the +`ofxparse `__ python lib. + +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 to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Odoo SA +* Akretion +* La Louve +* GRAP +* Nicolas JEUDY +* Le Filament + +Contributors +------------ + +- Odoo SA +- Alexis de Lattre +- Laurent Mignon +- Ronald Portier +- Sylvain LE GAL +- Nicolas JEUDY +- Le Filament + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +.. |maintainer-alexis-via| image:: https://github.com/alexis-via.png?size=40px + :target: https://github.com/alexis-via + :alt: alexis-via + +Current `maintainer `__: + +|maintainer-alexis-via| + +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_statement_import_ofx/__init__.py b/account_statement_import_ofx/__init__.py new file mode 100644 index 00000000..9b429614 --- /dev/null +++ b/account_statement_import_ofx/__init__.py @@ -0,0 +1,2 @@ +from . import models +from . import wizard diff --git a/account_statement_import_ofx/__manifest__.py b/account_statement_import_ofx/__manifest__.py new file mode 100644 index 00000000..8b215ff7 --- /dev/null +++ b/account_statement_import_ofx/__manifest__.py @@ -0,0 +1,20 @@ +{ + "name": "Import OFX Bank Statement", + "category": "Banking addons", + "version": "17.0.1.0.0", + "license": "AGPL-3", + "author": "Odoo SA," + "Akretion," + "La Louve," + "GRAP," + "Nicolas JEUDY," + "Le Filament," + "Odoo Community Association (OCA)", + "maintainers": ["alexis-via"], + "development_status": "Mature", + "website": "https://github.com/OCA/bank-statement-import", + "depends": ["account_statement_import_file"], + "data": ["wizard/account_statement_import.xml"], + "external_dependencies": {"python": ["ofxparse"]}, + "installable": True, +} diff --git a/account_statement_import_ofx/i18n/account_bank_statement_import_ofx.pot b/account_statement_import_ofx/i18n/account_bank_statement_import_ofx.pot new file mode 100644 index 00000000..8f4b849a --- /dev/null +++ b/account_statement_import_ofx/i18n/account_bank_statement_import_ofx.pot @@ -0,0 +1,38 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_bank_statement_import_ofx +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_bank_statement_import_ofx +#: model:ir.model,name:account_bank_statement_import_ofx.model_account_bank_statement_import +msgid "Import Bank Statement" +msgstr "" + +#. module: account_bank_statement_import_ofx +#: model:ir.model,name:account_bank_statement_import_ofx.model_account_journal +msgid "Journal" +msgstr "" + +#. module: account_bank_statement_import_ofx +#: model_terms:ir.ui.view,arch_db:account_bank_statement_import_ofx.view_account_bank_statement_import_form +msgid "Open Financial Exchange (.OFX Money)" +msgstr "" + +#. module: account_bank_statement_import_ofx +#: code:addons/account_bank_statement_import_ofx/wizard/account_bank_statement_import.py:85 +#, python-format +msgid "The following problem occurred during import. The file might not be valid.\n" +"\n" +" %s" +msgstr "" + diff --git a/account_statement_import_ofx/i18n/account_statement_import_ofx.pot b/account_statement_import_ofx/i18n/account_statement_import_ofx.pot new file mode 100644 index 00000000..8ee2d813 --- /dev/null +++ b/account_statement_import_ofx/i18n/account_statement_import_ofx.pot @@ -0,0 +1,39 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_statement_import_ofx +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_statement_import_ofx +#: model:ir.model,name:account_statement_import_ofx.model_account_statement_import +msgid "Import Bank Statement Files" +msgstr "" + +#. module: account_statement_import_ofx +#: model:ir.model,name:account_statement_import_ofx.model_account_journal +msgid "Journal" +msgstr "" + +#. module: account_statement_import_ofx +#: model_terms:ir.ui.view,arch_db:account_statement_import_ofx.account_statement_import_form +msgid "Open Financial Exchange (.OFX Money)" +msgstr "" + +#. module: account_statement_import_ofx +#. odoo-python +#: code:addons/account_statement_import_ofx/wizard/account_statement_import.py:0 +#, python-format +msgid "" +"The following problem occurred during import. The file might not be valid.\n" +"\n" +" %s" +msgstr "" diff --git a/account_statement_import_ofx/i18n/de.po b/account_statement_import_ofx/i18n/de.po new file mode 100644 index 00000000..3e41deff --- /dev/null +++ b/account_statement_import_ofx/i18n/de.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_bank_statement_import_ofx +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-04-11 21:55+0000\n" +"PO-Revision-Date: 2017-04-11 21:55+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: account_statement_import_ofx +#: model:ir.model,name:account_statement_import_ofx.model_account_statement_import +#, fuzzy +msgid "Import Bank Statement Files" +msgstr "Kontoauszug importieren" + +#. module: account_statement_import_ofx +#: model:ir.model,name:account_statement_import_ofx.model_account_journal +msgid "Journal" +msgstr "" + +#. module: account_statement_import_ofx +#: model_terms:ir.ui.view,arch_db:account_statement_import_ofx.account_statement_import_form +msgid "Open Financial Exchange (.OFX Money)" +msgstr "Open Financial Exchange (.OFX Money)" + +#. module: account_statement_import_ofx +#. odoo-python +#: code:addons/account_statement_import_ofx/wizard/account_statement_import.py:0 +#, python-format +msgid "" +"The following problem occurred during import. The file might not be valid.\n" +"\n" +" %s" +msgstr "" +"Das folgende Problem ist beim Importieren aufgetreten. Die Datei ist dürfte " +"ungültig sein.\n" +"\n" +"%s" diff --git a/account_statement_import_ofx/i18n/es.po b/account_statement_import_ofx/i18n/es.po new file mode 100644 index 00000000..f5634360 --- /dev/null +++ b/account_statement_import_ofx/i18n/es.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_bank_statement_import_ofx +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: bank-statement-import (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-07-24 21:51+0000\n" +"PO-Revision-Date: 2023-05-17 11:34+0000\n" +"Last-Translator: gelo joga Rodríguez \n" +"Language-Team: Spanish (http://www.transifex.com/oca/OCA-bank-statement-" +"import-8-0/language/es/)\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.14.1\n" + +#. module: account_statement_import_ofx +#: model:ir.model,name:account_statement_import_ofx.model_account_statement_import +msgid "Import Bank Statement Files" +msgstr "Importar archivos de extractos bancarios" + +#. module: account_statement_import_ofx +#: model:ir.model,name:account_statement_import_ofx.model_account_journal +msgid "Journal" +msgstr "Diario" + +#. module: account_statement_import_ofx +#: model_terms:ir.ui.view,arch_db:account_statement_import_ofx.account_statement_import_form +msgid "Open Financial Exchange (.OFX Money)" +msgstr "Abrir intercambio financiero (.OFX Money)" + +#. module: account_statement_import_ofx +#. odoo-python +#: code:addons/account_statement_import_ofx/wizard/account_statement_import.py:0 +#, python-format +msgid "" +"The following problem occurred during import. The file might not be valid.\n" +"\n" +" %s" +msgstr "" +"El siguiente problema ocurrió durante la importación. Es posible que el " +"archivo no sea válido.\n" +"\n" +" %s" diff --git a/account_statement_import_ofx/i18n/es_AR.po b/account_statement_import_ofx/i18n/es_AR.po new file mode 100644 index 00000000..8f4259a1 --- /dev/null +++ b/account_statement_import_ofx/i18n/es_AR.po @@ -0,0 +1,55 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_statement_import_ofx +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2022-01-07 16:40+0000\n" +"Last-Translator: Ignacio Buioli \n" +"Language-Team: none\n" +"Language: es_AR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.3.2\n" + +#. module: account_statement_import_ofx +#: model:ir.model,name:account_statement_import_ofx.model_account_statement_import +msgid "Import Bank Statement Files" +msgstr "Importar Archivos de Extractos Bancarios" + +#. module: account_statement_import_ofx +#: model:ir.model,name:account_statement_import_ofx.model_account_journal +msgid "Journal" +msgstr "Diario" + +#. module: account_statement_import_ofx +#: model_terms:ir.ui.view,arch_db:account_statement_import_ofx.account_statement_import_form +msgid "Open Financial Exchange (.OFX Money)" +msgstr "Open Financial Exchange (.OFX Dinero)" + +#. module: account_statement_import_ofx +#. odoo-python +#: code:addons/account_statement_import_ofx/wizard/account_statement_import.py:0 +#, python-format +msgid "" +"The following problem occurred during import. The file might not be valid.\n" +"\n" +" %s" +msgstr "" +"El siguiente problema ocurrió durante la importación. Es posible que el " +"archivo no sea válido.\n" +"\n" +" %s" + +#~ msgid "Display Name" +#~ msgstr "Mostrar Nombre" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Última modificación en" diff --git a/account_statement_import_ofx/i18n/fi.po b/account_statement_import_ofx/i18n/fi.po new file mode 100644 index 00000000..0953c69a --- /dev/null +++ b/account_statement_import_ofx/i18n/fi.po @@ -0,0 +1,45 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_bank_statement_import_ofx +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-03-19 03:39+0000\n" +"PO-Revision-Date: 2017-03-19 03:39+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Finnish (https://www.transifex.com/oca/teams/23907/fi/)\n" +"Language: fi\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: account_statement_import_ofx +#: model:ir.model,name:account_statement_import_ofx.model_account_statement_import +#, fuzzy +msgid "Import Bank Statement Files" +msgstr "Tuo pankkiaineisto" + +#. module: account_statement_import_ofx +#: model:ir.model,name:account_statement_import_ofx.model_account_journal +msgid "Journal" +msgstr "" + +#. module: account_statement_import_ofx +#: model_terms:ir.ui.view,arch_db:account_statement_import_ofx.account_statement_import_form +msgid "Open Financial Exchange (.OFX Money)" +msgstr "" + +#. module: account_statement_import_ofx +#. odoo-python +#: code:addons/account_statement_import_ofx/wizard/account_statement_import.py:0 +#, python-format +msgid "" +"The following problem occurred during import. The file might not be valid.\n" +"\n" +" %s" +msgstr "" diff --git a/account_statement_import_ofx/i18n/fr.po b/account_statement_import_ofx/i18n/fr.po new file mode 100644 index 00000000..b434e55c --- /dev/null +++ b/account_statement_import_ofx/i18n/fr.po @@ -0,0 +1,52 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_bank_statement_import_ofx +# +# Translators: +# OCA Transbot , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-04-11 21:55+0000\n" +"PO-Revision-Date: 2023-06-08 14:08+0000\n" +"Last-Translator: Alexis de Lattre \n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: account_statement_import_ofx +#: model:ir.model,name:account_statement_import_ofx.model_account_statement_import +msgid "Import Bank Statement Files" +msgstr "Import des relevés de compte" + +#. module: account_statement_import_ofx +#: model:ir.model,name:account_statement_import_ofx.model_account_journal +msgid "Journal" +msgstr "Journal" + +#. module: account_statement_import_ofx +#: model_terms:ir.ui.view,arch_db:account_statement_import_ofx.account_statement_import_form +msgid "Open Financial Exchange (.OFX Money)" +msgstr "Open Financial Exchange (.OFX Money)" + +#. module: account_statement_import_ofx +#. odoo-python +#: code:addons/account_statement_import_ofx/wizard/account_statement_import.py:0 +#, python-format +msgid "" +"The following problem occurred during import. The file might not be valid.\n" +"\n" +" %s" +msgstr "" +"Le problème suivant est survenu lors de l'import. Le fichier n'est peut-être " +"pas valide.\n" +"\n" +"%s" + +#~ msgid "Last Modified on" +#~ msgstr "Dernière modification" diff --git a/account_statement_import_ofx/i18n/fr_CH.po b/account_statement_import_ofx/i18n/fr_CH.po new file mode 100644 index 00000000..d5c8b913 --- /dev/null +++ b/account_statement_import_ofx/i18n/fr_CH.po @@ -0,0 +1,46 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_bank_statement_import_ofx +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-03-19 03:39+0000\n" +"PO-Revision-Date: 2017-03-19 03:39+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: French (Switzerland) (https://www.transifex.com/oca/" +"teams/23907/fr_CH/)\n" +"Language: fr_CH\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: account_statement_import_ofx +#: model:ir.model,name:account_statement_import_ofx.model_account_statement_import +#, fuzzy +msgid "Import Bank Statement Files" +msgstr "Importer Relevé" + +#. module: account_statement_import_ofx +#: model:ir.model,name:account_statement_import_ofx.model_account_journal +msgid "Journal" +msgstr "" + +#. module: account_statement_import_ofx +#: model_terms:ir.ui.view,arch_db:account_statement_import_ofx.account_statement_import_form +msgid "Open Financial Exchange (.OFX Money)" +msgstr "" + +#. module: account_statement_import_ofx +#. odoo-python +#: code:addons/account_statement_import_ofx/wizard/account_statement_import.py:0 +#, python-format +msgid "" +"The following problem occurred during import. The file might not be valid.\n" +"\n" +" %s" +msgstr "" diff --git a/account_statement_import_ofx/i18n/fr_FR.po b/account_statement_import_ofx/i18n/fr_FR.po new file mode 100644 index 00000000..22b57757 --- /dev/null +++ b/account_statement_import_ofx/i18n/fr_FR.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_statement_import_ofx +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-04-10 17:46+0000\n" +"Last-Translator: Yves Le Doeuff \n" +"Language-Team: none\n" +"Language: fr_FR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 4.3.2\n" + +#. module: account_statement_import_ofx +#: model:ir.model,name:account_statement_import_ofx.model_account_statement_import +msgid "Import Bank Statement Files" +msgstr "Importer des Relevés Bancaires" + +#. module: account_statement_import_ofx +#: model:ir.model,name:account_statement_import_ofx.model_account_journal +msgid "Journal" +msgstr "" + +#. module: account_statement_import_ofx +#: model_terms:ir.ui.view,arch_db:account_statement_import_ofx.account_statement_import_form +msgid "Open Financial Exchange (.OFX Money)" +msgstr "Open Financial Exchange (.OFX Money)" + +#. module: account_statement_import_ofx +#. odoo-python +#: code:addons/account_statement_import_ofx/wizard/account_statement_import.py:0 +#, python-format +msgid "" +"The following problem occurred during import. The file might not be valid.\n" +"\n" +" %s" +msgstr "" +"Le problème suivant est survenu lors de l'importation. Le fichier n'est pas " +"valide.\n" +"\n" +"%s" + +#~ msgid "Last Modified on" +#~ msgstr "Dernière modification" diff --git a/account_statement_import_ofx/i18n/gl.po b/account_statement_import_ofx/i18n/gl.po new file mode 100644 index 00000000..2e291f71 --- /dev/null +++ b/account_statement_import_ofx/i18n/gl.po @@ -0,0 +1,45 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_bank_statement_import_ofx +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-03-19 03:39+0000\n" +"PO-Revision-Date: 2017-03-19 03:39+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Galician (https://www.transifex.com/oca/teams/23907/gl/)\n" +"Language: gl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: account_statement_import_ofx +#: model:ir.model,name:account_statement_import_ofx.model_account_statement_import +#, fuzzy +msgid "Import Bank Statement Files" +msgstr "Importar extracto bancario" + +#. module: account_statement_import_ofx +#: model:ir.model,name:account_statement_import_ofx.model_account_journal +msgid "Journal" +msgstr "" + +#. module: account_statement_import_ofx +#: model_terms:ir.ui.view,arch_db:account_statement_import_ofx.account_statement_import_form +msgid "Open Financial Exchange (.OFX Money)" +msgstr "" + +#. module: account_statement_import_ofx +#. odoo-python +#: code:addons/account_statement_import_ofx/wizard/account_statement_import.py:0 +#, python-format +msgid "" +"The following problem occurred during import. The file might not be valid.\n" +"\n" +" %s" +msgstr "" diff --git a/account_statement_import_ofx/i18n/it.po b/account_statement_import_ofx/i18n/it.po new file mode 100644 index 00000000..954f4da4 --- /dev/null +++ b/account_statement_import_ofx/i18n/it.po @@ -0,0 +1,55 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_statement_import_ofx +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-05-06 11:37+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: account_statement_import_ofx +#: model:ir.model,name:account_statement_import_ofx.model_account_statement_import +msgid "Import Bank Statement Files" +msgstr "Importazione file estratto conto bancario" + +#. module: account_statement_import_ofx +#: model:ir.model,name:account_statement_import_ofx.model_account_journal +msgid "Journal" +msgstr "Registro" + +#. module: account_statement_import_ofx +#: model_terms:ir.ui.view,arch_db:account_statement_import_ofx.account_statement_import_form +msgid "Open Financial Exchange (.OFX Money)" +msgstr "Open Financial Exchange (Valuta .OFX)" + +#. module: account_statement_import_ofx +#. odoo-python +#: code:addons/account_statement_import_ofx/wizard/account_statement_import.py:0 +#, python-format +msgid "" +"The following problem occurred during import. The file might not be valid.\n" +"\n" +" %s" +msgstr "" +"Il seguente problema si è verificato durante l'importazione. Il file " +"potrebbe non essere valido.\n" +"\n" +" %s" + +#~ msgid "Display Name" +#~ msgstr "Nome visualizzato" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Ultima modifica il" diff --git a/account_statement_import_ofx/i18n/lt_LT.po b/account_statement_import_ofx/i18n/lt_LT.po new file mode 100644 index 00000000..7e3d6739 --- /dev/null +++ b/account_statement_import_ofx/i18n/lt_LT.po @@ -0,0 +1,50 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_bank_statement_import_ofx +# +# Translators: +# OCA Transbot , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-04-11 21:55+0000\n" +"PO-Revision-Date: 2017-04-11 21:55+0000\n" +"Last-Translator: OCA Transbot , 2016\n" +"Language-Team: Lithuanian (Lithuania) (https://www.transifex.com/oca/" +"teams/23907/lt_LT/)\n" +"Language: lt_LT\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n" +"%100<10 || n%100>=20) ? 1 : 2);\n" + +#. module: account_statement_import_ofx +#: model:ir.model,name:account_statement_import_ofx.model_account_statement_import +#, fuzzy +msgid "Import Bank Statement Files" +msgstr "Importuoti banko išrašą" + +#. module: account_statement_import_ofx +#: model:ir.model,name:account_statement_import_ofx.model_account_journal +msgid "Journal" +msgstr "" + +#. module: account_statement_import_ofx +#: model_terms:ir.ui.view,arch_db:account_statement_import_ofx.account_statement_import_form +msgid "Open Financial Exchange (.OFX Money)" +msgstr "" + +#. module: account_statement_import_ofx +#. odoo-python +#: code:addons/account_statement_import_ofx/wizard/account_statement_import.py:0 +#, python-format +msgid "" +"The following problem occurred during import. The file might not be valid.\n" +"\n" +" %s" +msgstr "" +"Klaida. Failas gali būti sugadintas arba negaliojantis.\n" +"\n" +" %s" diff --git a/account_statement_import_ofx/i18n/nb_NO.po b/account_statement_import_ofx/i18n/nb_NO.po new file mode 100644 index 00000000..fde0d43e --- /dev/null +++ b/account_statement_import_ofx/i18n/nb_NO.po @@ -0,0 +1,46 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_bank_statement_import_ofx +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-03-19 03:39+0000\n" +"PO-Revision-Date: 2017-03-19 03:39+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Norwegian Bokmål (Norway) (https://www.transifex.com/oca/" +"teams/23907/nb_NO/)\n" +"Language: nb_NO\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: account_statement_import_ofx +#: model:ir.model,name:account_statement_import_ofx.model_account_statement_import +#, fuzzy +msgid "Import Bank Statement Files" +msgstr "Importer bankutsagn" + +#. module: account_statement_import_ofx +#: model:ir.model,name:account_statement_import_ofx.model_account_journal +msgid "Journal" +msgstr "" + +#. module: account_statement_import_ofx +#: model_terms:ir.ui.view,arch_db:account_statement_import_ofx.account_statement_import_form +msgid "Open Financial Exchange (.OFX Money)" +msgstr "" + +#. module: account_statement_import_ofx +#. odoo-python +#: code:addons/account_statement_import_ofx/wizard/account_statement_import.py:0 +#, python-format +msgid "" +"The following problem occurred during import. The file might not be valid.\n" +"\n" +" %s" +msgstr "" diff --git a/account_statement_import_ofx/i18n/nl.po b/account_statement_import_ofx/i18n/nl.po new file mode 100644 index 00000000..16cf33f9 --- /dev/null +++ b/account_statement_import_ofx/i18n/nl.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_bank_statement_import_ofx +# +# Translators: +# OCA Transbot , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-04-11 21:55+0000\n" +"PO-Revision-Date: 2017-04-11 21:55+0000\n" +"Last-Translator: OCA Transbot , 2016\n" +"Language-Team: Dutch (https://www.transifex.com/oca/teams/23907/nl/)\n" +"Language: nl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: account_statement_import_ofx +#: model:ir.model,name:account_statement_import_ofx.model_account_statement_import +#, fuzzy +msgid "Import Bank Statement Files" +msgstr "Importeer bankafschrift" + +#. module: account_statement_import_ofx +#: model:ir.model,name:account_statement_import_ofx.model_account_journal +msgid "Journal" +msgstr "" + +#. module: account_statement_import_ofx +#: model_terms:ir.ui.view,arch_db:account_statement_import_ofx.account_statement_import_form +msgid "Open Financial Exchange (.OFX Money)" +msgstr "" + +#. module: account_statement_import_ofx +#. odoo-python +#: code:addons/account_statement_import_ofx/wizard/account_statement_import.py:0 +#, python-format +msgid "" +"The following problem occurred during import. The file might not be valid.\n" +"\n" +" %s" +msgstr "" +"Het volgende probleem is opgetreden tijdens de import. Het bestand is " +"waarschijnlijk niet juist.\n" +"\n" +"%s" diff --git a/account_statement_import_ofx/i18n/pt_BR.po b/account_statement_import_ofx/i18n/pt_BR.po new file mode 100644 index 00000000..be00aeef --- /dev/null +++ b/account_statement_import_ofx/i18n/pt_BR.po @@ -0,0 +1,50 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_bank_statement_import_ofx +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-11-21 01:42+0000\n" +"PO-Revision-Date: 2023-12-28 23:48+0000\n" +"Last-Translator: Adriano Prado \n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/" +"23907/pt_BR/)\n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: account_statement_import_ofx +#: model:ir.model,name:account_statement_import_ofx.model_account_statement_import +msgid "Import Bank Statement Files" +msgstr "Importar Arquivos Extrato Bancário" + +#. module: account_statement_import_ofx +#: model:ir.model,name:account_statement_import_ofx.model_account_journal +msgid "Journal" +msgstr "Diário" + +#. module: account_statement_import_ofx +#: model_terms:ir.ui.view,arch_db:account_statement_import_ofx.account_statement_import_form +msgid "Open Financial Exchange (.OFX Money)" +msgstr "Troca Financeira Aberta (.OFX Money)" + +#. module: account_statement_import_ofx +#. odoo-python +#: code:addons/account_statement_import_ofx/wizard/account_statement_import.py:0 +#, python-format +msgid "" +"The following problem occurred during import. The file might not be valid.\n" +"\n" +" %s" +msgstr "" +"O seguinte problema ocorreu durante a importação. O arquivo não deve ser " +"válido.\n" +"\n" +"%s" diff --git a/account_statement_import_ofx/i18n/pt_PT.po b/account_statement_import_ofx/i18n/pt_PT.po new file mode 100644 index 00000000..bece783b --- /dev/null +++ b/account_statement_import_ofx/i18n/pt_PT.po @@ -0,0 +1,46 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_bank_statement_import_ofx +# +# Translators: +# OCA Transbot , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-03-19 03:39+0000\n" +"PO-Revision-Date: 2017-03-19 03:39+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Portuguese (Portugal) (https://www.transifex.com/oca/" +"teams/23907/pt_PT/)\n" +"Language: pt_PT\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: account_statement_import_ofx +#: model:ir.model,name:account_statement_import_ofx.model_account_statement_import +#, fuzzy +msgid "Import Bank Statement Files" +msgstr "Importar Extrato Bancário" + +#. module: account_statement_import_ofx +#: model:ir.model,name:account_statement_import_ofx.model_account_journal +msgid "Journal" +msgstr "" + +#. module: account_statement_import_ofx +#: model_terms:ir.ui.view,arch_db:account_statement_import_ofx.account_statement_import_form +msgid "Open Financial Exchange (.OFX Money)" +msgstr "" + +#. module: account_statement_import_ofx +#. odoo-python +#: code:addons/account_statement_import_ofx/wizard/account_statement_import.py:0 +#, python-format +msgid "" +"The following problem occurred during import. The file might not be valid.\n" +"\n" +" %s" +msgstr "" diff --git a/account_statement_import_ofx/i18n/sl.po b/account_statement_import_ofx/i18n/sl.po new file mode 100644 index 00000000..73f90703 --- /dev/null +++ b/account_statement_import_ofx/i18n/sl.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_bank_statement_import_ofx +# +# Translators: +# OCA Transbot , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-04-11 21:55+0000\n" +"PO-Revision-Date: 2017-04-11 21:55+0000\n" +"Last-Translator: OCA Transbot , 2016\n" +"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" +"Language: sl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n" +"%100==4 ? 2 : 3);\n" + +#. module: account_statement_import_ofx +#: model:ir.model,name:account_statement_import_ofx.model_account_statement_import +#, fuzzy +msgid "Import Bank Statement Files" +msgstr "Uvoz bančnega izpiska" + +#. module: account_statement_import_ofx +#: model:ir.model,name:account_statement_import_ofx.model_account_journal +msgid "Journal" +msgstr "" + +#. module: account_statement_import_ofx +#: model_terms:ir.ui.view,arch_db:account_statement_import_ofx.account_statement_import_form +msgid "Open Financial Exchange (.OFX Money)" +msgstr "" + +#. module: account_statement_import_ofx +#. odoo-python +#: code:addons/account_statement_import_ofx/wizard/account_statement_import.py:0 +#, python-format +msgid "" +"The following problem occurred during import. The file might not be valid.\n" +"\n" +" %s" +msgstr "" +"Med uvozom je prišlo do težav. Datoteka ni veljavna.\n" +"\n" +" %s" diff --git a/account_statement_import_ofx/models/__init__.py b/account_statement_import_ofx/models/__init__.py new file mode 100644 index 00000000..2388e119 --- /dev/null +++ b/account_statement_import_ofx/models/__init__.py @@ -0,0 +1 @@ +from . import account_journal diff --git a/account_statement_import_ofx/models/account_journal.py b/account_statement_import_ofx/models/account_journal.py new file mode 100644 index 00000000..efbb0b86 --- /dev/null +++ b/account_statement_import_ofx/models/account_journal.py @@ -0,0 +1,11 @@ +from odoo import models + + +class AccountJournal(models.Model): + _inherit = "account.journal" + + def _get_bank_statements_available_import_formats(self): + """Adds ofx to supported import formats.""" + rslt = super()._get_bank_statements_available_import_formats() + rslt.append("ofx") + return rslt diff --git a/account_statement_import_ofx/pyproject.toml b/account_statement_import_ofx/pyproject.toml new file mode 100644 index 00000000..4231d0cc --- /dev/null +++ b/account_statement_import_ofx/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/account_statement_import_ofx/readme/CONTRIBUTORS.md b/account_statement_import_ofx/readme/CONTRIBUTORS.md new file mode 100644 index 00000000..d98643b6 --- /dev/null +++ b/account_statement_import_ofx/readme/CONTRIBUTORS.md @@ -0,0 +1,7 @@ +- Odoo SA +- Alexis de Lattre \<\> +- Laurent Mignon \<\> +- Ronald Portier \<\> +- Sylvain LE GAL \<\> +- Nicolas JEUDY \<\> +- Le Filament \<\> diff --git a/account_statement_import_ofx/readme/DESCRIPTION.md b/account_statement_import_ofx/readme/DESCRIPTION.md new file mode 100644 index 00000000..8f8596a5 --- /dev/null +++ b/account_statement_import_ofx/readme/DESCRIPTION.md @@ -0,0 +1,9 @@ +This module adds support for the import of bank statements in [OFX +format](https://en.wikipedia.org/wiki/Open_Financial_Exchange). + +Bank Statements may be generated containing a subset of the OFX +information (only those transaction lines that are required for the +creation of the Financial Accounting records). + +Since v14, this module support multi-account OFX files i.e. several +different bank accounts in the same OFX file. diff --git a/account_statement_import_ofx/readme/INSTALL.md b/account_statement_import_ofx/readme/INSTALL.md new file mode 100644 index 00000000..87ffba43 --- /dev/null +++ b/account_statement_import_ofx/readme/INSTALL.md @@ -0,0 +1,2 @@ +This module requires the [ofxparse](https://pypi.org/project/ofxparse/) +python lib. diff --git a/account_statement_import_ofx/static/description/icon.png b/account_statement_import_ofx/static/description/icon.png new file mode 100644 index 00000000..c630877c Binary files /dev/null and b/account_statement_import_ofx/static/description/icon.png differ diff --git a/account_statement_import_ofx/static/description/index.html b/account_statement_import_ofx/static/description/index.html new file mode 100644 index 00000000..1734c306 --- /dev/null +++ b/account_statement_import_ofx/static/description/index.html @@ -0,0 +1,448 @@ + + + + + +Import OFX Bank Statement + + + +
+

Import OFX Bank Statement

+ + +

Mature License: AGPL-3 OCA/bank-statement-import Translate me on Weblate Try me on Runboat

+

This module adds support for the import of bank statements in OFX +format.

+

Bank Statements may be generated containing a subset of the OFX +information (only those transaction lines that are required for the +creation of the Financial Accounting records).

+

Since v14, this module support multi-account OFX files i.e. several +different bank accounts in the same OFX file.

+

Table of contents

+ +
+

Installation

+

This module requires the +ofxparse python lib.

+
+
+

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 to smash it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Odoo SA
  • +
  • Akretion
  • +
  • La Louve
  • +
  • GRAP
  • +
  • Nicolas JEUDY
  • +
  • Le Filament
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

Current maintainer:

+

alexis-via

+

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_statement_import_ofx/tests/__init__.py b/account_statement_import_ofx/tests/__init__.py new file mode 100644 index 00000000..bb3456ae --- /dev/null +++ b/account_statement_import_ofx/tests/__init__.py @@ -0,0 +1 @@ +from . import test_import_bank_statement diff --git a/account_statement_import_ofx/tests/test_import_bank_statement.py b/account_statement_import_ofx/tests/test_import_bank_statement.py new file mode 100644 index 00000000..03995d20 --- /dev/null +++ b/account_statement_import_ofx/tests/test_import_bank_statement.py @@ -0,0 +1,103 @@ +import base64 +import datetime + +import odoo.tests.common as common +from odoo.tools.misc import file_path + + +class TestOfxFile(common.TransactionCase): + """Tests for import bank statement ofx file format + (account.bank.statement.import) + """ + + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.asi_model = cls.env["account.statement.import"] + cls.abs_model = cls.env["account.bank.statement"] + cls.absl_model = cls.env["account.bank.statement.line"] + cur = cls.env.ref("base.USD") + bank = cls.env["res.partner.bank"].create( + { + "acc_number": "123456", + "partner_id": cls.env.ref("base.main_partner").id, + "company_id": cls.env.ref("base.main_company").id, + "bank_id": cls.env.ref("base.res_bank_1").id, + } + ) + cls.env["account.journal"].create( + { + "name": "Bank Journal TEST OFX", + "code": "BNK12", + "type": "bank", + "bank_account_id": bank.id, + "currency_id": cur.id, + } + ) + bank_iban_ofx = cls.env["res.partner.bank"].create( + { + "acc_number": "FR7630001007941234567890185", + "partner_id": cls.env.ref("base.main_partner").id, + "company_id": cls.env.ref("base.main_company").id, + "bank_id": cls.env.ref("base.res_bank_1").id, + } + ) + cls.env["account.journal"].create( + { + "name": "FR7630001007941234567890185", + "code": "BNK13", + "type": "bank", + "bank_account_id": bank_iban_ofx.id, + "currency_id": cur.id, + } + ) + + def test_wrong_ofx_file_import(self): + ofx_file_path = file_path( + "account_statement_import_ofx/tests/test_ofx_file/test_ofx_wrong.ofx" + ) + ofx_file_wrong = base64.b64encode(open(ofx_file_path, "rb").read()) + bank_statement = self.asi_model.create( + { + "statement_file": ofx_file_wrong, + "statement_filename": "test_ofx_wrong.ofx", + } + ) + self.assertFalse(bank_statement._check_ofx(data_file=ofx_file_wrong)) + + def test_ofx_file_import(self): + ofx_file_path = file_path( + "account_statement_import_ofx/tests/test_ofx_file/test_ofx.ofx" + ) + ofx_file = base64.b64encode(open(ofx_file_path, "rb").read()) + bank_statement = self.asi_model.create( + { + "statement_file": ofx_file, + "statement_filename": "test_ofx.ofx", + } + ) + bank_statement.import_file_button() + bank_st_record = self.abs_model.search([("name", "like", "123456")])[0] + self.assertEqual(bank_st_record.balance_start, 2516.56) + self.assertEqual(bank_st_record.balance_end_real, 2156.56) + + line = self.absl_model.search( + [ + ("payment_ref", "=", "Agrolait"), + ("statement_id", "=", bank_st_record.id), + ] + )[0] + self.assertEqual(line.date, datetime.date(2013, 8, 24)) + + def test_check_journal_bank_account(self): + ofx_file_path = file_path( + "account_statement_import_ofx/tests/test_ofx_file/test_ofx_iban.ofx" + ) + ofx_file = base64.b64encode(open(ofx_file_path, "rb").read()) + bank_st = self.asi_model.create( + { + "statement_file": ofx_file, + "statement_filename": "test_ofx_iban.ofx", + } + ) + bank_st.import_file_button() diff --git a/account_statement_import_ofx/tests/test_ofx_file/test_ofx.ofx b/account_statement_import_ofx/tests/test_ofx_file/test_ofx.ofx new file mode 100644 index 00000000..37df4d0c --- /dev/null +++ b/account_statement_import_ofx/tests/test_ofx_file/test_ofx.ofx @@ -0,0 +1,100 @@ + + + + + + + 0 + INFO + + 20130831165153.000[-8:PST] + ENG + + + + + 0 + + 0 + INFO + + + USD + + 000000123 + 123456 + CHECKING + + + 20130801 + 20130831165153.000[-8:PST] + + POS + 20130824080000 + -80 + 219378 + Agrolait + + + + 20130801 + 20130831165153.000[-8:PST] + + POS + 20130824080000 + -90 + 219379 + China Export + + + + 20130801 + 20130831165153.000[-8:PST] + + POS + 20130824080000 + -100 + 219380 + Axelor Scuba + + + + 20130801 + 20130831165153.000[-8:PST] + + POS + 20130824080000 + -90 + 219381 + China Scuba + + + + 2156.56 + 20130831165153 + + + + + + + 0 + + 0 + INFO + + + USD + + 123412341234 + + + + + -562.00 + 20130831165153 + + + + + diff --git a/account_statement_import_ofx/tests/test_ofx_file/test_ofx_iban.ofx b/account_statement_import_ofx/tests/test_ofx_file/test_ofx_iban.ofx new file mode 100644 index 00000000..99c01618 --- /dev/null +++ b/account_statement_import_ofx/tests/test_ofx_file/test_ofx_iban.ofx @@ -0,0 +1,101 @@ + + + + + + + 0 + INFO + + 20130831165153.000[-8:PST] + ENG + + + + + 0 + + 0 + INFO + + + USD + + 30001 + 00794 + 12345678901 + CHECKING + + + 20130801 + 20130831165153.000[-8:PST] + + POS + 20130824080000 + -80 + 219378 + Agrolait + + + + 20130801 + 20130831165153.000[-8:PST] + + POS + 20130824080000 + -90 + 219379 + China Export + + + + 20130801 + 20130831165153.000[-8:PST] + + POS + 20130824080000 + -100 + 219380 + Axelor Scuba + + + + 20130801 + 20130831165153.000[-8:PST] + + POS + 20130824080000 + -90 + 219381 + China Scuba + + + + 2156.56 + 20130831165153 + + + + + + + 0 + + 0 + INFO + + + USD + + 123412341234 + + + + + -562.00 + 20130831165153 + + + + + diff --git a/account_statement_import_ofx/tests/test_ofx_file/test_ofx_wrong.ofx b/account_statement_import_ofx/tests/test_ofx_file/test_ofx_wrong.ofx new file mode 100644 index 00000000..b9e64a39 --- /dev/null +++ b/account_statement_import_ofx/tests/test_ofx_file/test_ofx_wrong.ofx @@ -0,0 +1,100 @@ + + + + + + + 0 + INFO + + 20130831165153.000[-8:PST] + ENG + + + + + 0 + + 0 + INFO + + + + + 20130801 + 20130831165153.000[-8:PST] + + POS + 20130824080000 + -80 + 219378 + Agrolait + + + + 20130801 + 20130831165153.000[-8:PST] + + POS + + China Export + + + + 20130801 + 20130831165153.000[-8:PST] + + POS + 20130824080000 + -100 + 219380 + Axelor Scuba + + + + 20130801 + 20130831165153.000[-8:PST] + + POS + 20130824080000 + -90 + 219381 + China Scuba + + + + 2156.56 + 20130831165153 + + + + + + + 0 + + 0 + INFO + + + USD + + 123412341234 + + + + + -562.00 + 20130831165153 + + + + + diff --git a/account_statement_import_ofx/wizard/__init__.py b/account_statement_import_ofx/wizard/__init__.py new file mode 100644 index 00000000..ae69bca2 --- /dev/null +++ b/account_statement_import_ofx/wizard/__init__.py @@ -0,0 +1 @@ +from . import account_statement_import diff --git a/account_statement_import_ofx/wizard/account_statement_import.py b/account_statement_import_ofx/wizard/account_statement_import.py new file mode 100644 index 00000000..d88c9085 --- /dev/null +++ b/account_statement_import_ofx/wizard/account_statement_import.py @@ -0,0 +1,88 @@ +import io +import logging + +from odoo import _, api, models +from odoo.exceptions import UserError + +_logger = logging.getLogger(__name__) + +try: + from ofxparse import OfxParser +except ImportError: + _logger.debug("ofxparse not found.") + OfxParser = None + + +class AccountStatementImport(models.TransientModel): + _inherit = "account.statement.import" + + @api.model + def _check_ofx(self, data_file): + if not OfxParser: + return False + try: + ofx = OfxParser.parse(io.BytesIO(data_file)) + except Exception as e: + _logger.debug(e) + return False + return ofx + + @api.model + def _prepare_ofx_transaction_line(self, transaction): + # Since ofxparse doesn't provide account numbers, + # we cannot provide the key 'bank_account_id', + # nor the key 'account_number' + # If you read odoo10/addons/account_bank_statement_import/ + # account_bank_statement_import.py, it's the only 2 keys + # we can provide to match a partner. + payment_ref = transaction.payee + if transaction.checknum: + payment_ref += " " + transaction.checknum + if transaction.memo: + payment_ref += " : " + transaction.memo + vals = { + "date": transaction.date, + "payment_ref": payment_ref, + "amount": float(transaction.amount), + "unique_import_id": transaction.id, + } + return vals + + def _parse_file(self, data_file): + ofx = self._check_ofx(data_file) + if not ofx: + return super()._parse_file(data_file) + + result = [] + try: + for account in ofx.accounts: + transactions = [] + total_amt = 0.00 + + if not account.statement.transactions: + continue + + for transaction in account.statement.transactions: + vals = self._prepare_ofx_transaction_line(transaction) + if vals: + transactions.append(vals) + total_amt += vals["amount"] + balance = float(account.statement.balance) + vals_bank_statement = { + "name": account.number, + "transactions": transactions, + "balance_start": balance - total_amt, + "balance_end_real": balance, + } + result.append( + (account.statement.currency, account.number, [vals_bank_statement]) + ) + except Exception as e: + raise UserError( + _( + "The following problem occurred during import. " + "The file might not be valid.\n\n %s" + ) + % str(e) + ) from e + return result diff --git a/account_statement_import_ofx/wizard/account_statement_import.xml b/account_statement_import_ofx/wizard/account_statement_import.xml new file mode 100644 index 00000000..6d8b68da --- /dev/null +++ b/account_statement_import_ofx/wizard/account_statement_import.xml @@ -0,0 +1,15 @@ + + + + account.statement.import + + + +
  • Open Financial Exchange (.OFX Money)
  • +
    +
    +
    +
    diff --git a/requirements.txt b/requirements.txt index 5a2df807..d3433a96 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ # generated from manifests external_dependencies chardet +ofxparse xlrd