From ad6a1a74dd48169ab7cb5e3051c045f92884312d Mon Sep 17 00:00:00 2001 From: Mathias Markl Date: Wed, 11 Apr 2018 17:12:58 +0200 Subject: [PATCH] [11.0] [MIG] account_bank_statement_import_ofx --- account_bank_statement_import_ofx/README.rst | 66 ++++++++++++ account_bank_statement_import_ofx/__init__.py | 2 + .../__manifest__.py | 23 ++++ .../account_bank_statement_import_ofx.pot | 30 ++++++ account_bank_statement_import_ofx/i18n/de.po | 41 +++++++ account_bank_statement_import_ofx/i18n/es.po | 42 ++++++++ account_bank_statement_import_ofx/i18n/fi.po | 38 +++++++ account_bank_statement_import_ofx/i18n/fr.po | 41 +++++++ .../i18n/fr_CH.po | 38 +++++++ account_bank_statement_import_ofx/i18n/gl.po | 38 +++++++ account_bank_statement_import_ofx/i18n/hr.po | 38 +++++++ .../i18n/lt_LT.po | 41 +++++++ .../i18n/nb_NO.po | 38 +++++++ account_bank_statement_import_ofx/i18n/nl.po | 41 +++++++ .../i18n/pt_BR.po | 41 +++++++ .../i18n/pt_PT.po | 38 +++++++ account_bank_statement_import_ofx/i18n/sl.po | 41 +++++++ .../static/description/icon.png | Bin 0 -> 6282 bytes .../tests/__init__.py | 2 + .../tests/test_import_bank_statement.py | 50 +++++++++ .../tests/test_ofx_file/test_ofx.ofx | 100 ++++++++++++++++++ .../view_account_bank_statement_import.xml | 12 +++ .../wizard/__init__.py | 2 + .../wizard/account_bank_statement_import.py | 77 ++++++++++++++ 24 files changed, 880 insertions(+) create mode 100644 account_bank_statement_import_ofx/README.rst create mode 100644 account_bank_statement_import_ofx/__init__.py create mode 100644 account_bank_statement_import_ofx/__manifest__.py create mode 100644 account_bank_statement_import_ofx/i18n/account_bank_statement_import_ofx.pot create mode 100644 account_bank_statement_import_ofx/i18n/de.po create mode 100644 account_bank_statement_import_ofx/i18n/es.po create mode 100644 account_bank_statement_import_ofx/i18n/fi.po create mode 100644 account_bank_statement_import_ofx/i18n/fr.po create mode 100644 account_bank_statement_import_ofx/i18n/fr_CH.po create mode 100644 account_bank_statement_import_ofx/i18n/gl.po create mode 100644 account_bank_statement_import_ofx/i18n/hr.po create mode 100644 account_bank_statement_import_ofx/i18n/lt_LT.po create mode 100644 account_bank_statement_import_ofx/i18n/nb_NO.po create mode 100644 account_bank_statement_import_ofx/i18n/nl.po create mode 100644 account_bank_statement_import_ofx/i18n/pt_BR.po create mode 100644 account_bank_statement_import_ofx/i18n/pt_PT.po create mode 100644 account_bank_statement_import_ofx/i18n/sl.po create mode 100644 account_bank_statement_import_ofx/static/description/icon.png create mode 100644 account_bank_statement_import_ofx/tests/__init__.py create mode 100644 account_bank_statement_import_ofx/tests/test_import_bank_statement.py create mode 100644 account_bank_statement_import_ofx/tests/test_ofx_file/test_ofx.ofx create mode 100644 account_bank_statement_import_ofx/views/view_account_bank_statement_import.xml create mode 100644 account_bank_statement_import_ofx/wizard/__init__.py create mode 100644 account_bank_statement_import_ofx/wizard/account_bank_statement_import.py diff --git a/account_bank_statement_import_ofx/README.rst b/account_bank_statement_import_ofx/README.rst new file mode 100644 index 0000000..571c46f --- /dev/null +++ b/account_bank_statement_import_ofx/README.rst @@ -0,0 +1,66 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :alt: License: AGPL-3 + +========================= +Import OFX Bank Statement +========================= + +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). + +Installation +============ + +The module requires one additional python lib: + +* `ofxparse `_ + +Usage +===== + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/174/10.0 + +Known issues / Roadmap +====================== + +* None + +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. + +Credits +======= + +Contributors +------------ + +* Odoo SA +* Alexis de Lattre +* Laurent Mignon +* Ronald Portier +* Sylvain LE GAL +* Mathias Markl + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +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. + +To contribute to this module, please visit https://odoo-community.org. diff --git a/account_bank_statement_import_ofx/__init__.py b/account_bank_statement_import_ofx/__init__.py new file mode 100644 index 0000000..02baef4 --- /dev/null +++ b/account_bank_statement_import_ofx/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +from . import wizard diff --git a/account_bank_statement_import_ofx/__manifest__.py b/account_bank_statement_import_ofx/__manifest__.py new file mode 100644 index 0000000..8b12780 --- /dev/null +++ b/account_bank_statement_import_ofx/__manifest__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +{ + 'name': 'Import OFX Bank Statement', + 'category': 'Banking addons', + 'version': '11.0.1.0.0', + 'license': 'AGPL-3', + 'author': 'Odoo SA,' + 'Akretion,' + 'La Louve,' + 'GRAP,' + 'Odoo Community Association (OCA)', + 'website': 'https://odoo-community.org/', + 'depends': [ + 'account_bank_statement_import', + ], + 'data': [ + 'views/view_account_bank_statement_import.xml', + ], + 'external_dependencies': { + 'python': ['ofxparse'], + }, + 'installable': True, +} diff --git a/account_bank_statement_import_ofx/i18n/account_bank_statement_import_ofx.pot b/account_bank_statement_import_ofx/i18n/account_bank_statement_import_ofx.pot new file mode 100644 index 0000000..1c67daf --- /dev/null +++ b/account_bank_statement_import_ofx/i18n/account_bank_statement_import_ofx.pot @@ -0,0 +1,30 @@ +# 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 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-06-08 09:11+0000\n" +"PO-Revision-Date: 2015-06-08 09:11+0000\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 +#: code:addons/account_bank_statement_import_ofx/account_bank_statement_import_ofx.py:67 +#, python-format +msgid "The following problem occurred during import. The file might not be valid.\n" +"\n" +" %s" +msgstr "" + diff --git a/account_bank_statement_import_ofx/i18n/de.po b/account_bank_statement_import_ofx/i18n/de.po new file mode 100644 index 0000000..d178693 --- /dev/null +++ b/account_bank_statement_import_ofx/i18n/de.po @@ -0,0 +1,41 @@ +# 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" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: de\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\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 "Kontoauszug importieren" + +#. module: account_bank_statement_import_ofx +#: model:ir.ui.view,arch_db:account_bank_statement_import_ofx.view_account_bank_statement_import_form +msgid "Open Financial Exchange (.OFX Money)" +msgstr "Open Financial Exchange (.OFX Money)" + +#. module: account_bank_statement_import_ofx +#: code:addons/account_bank_statement_import_ofx/wizard/account_bank_statement_import.py:65 +#, 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_bank_statement_import_ofx/i18n/es.po b/account_bank_statement_import_ofx/i18n/es.po new file mode 100644 index 0000000..4b75cda --- /dev/null +++ b/account_bank_statement_import_ofx/i18n/es.po @@ -0,0 +1,42 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_bank_statement_import_ofx +# +# Translators: +# OCA Transbot , 2017 +# enjolras , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-02-21 01:41+0000\n" +"PO-Revision-Date: 2018-02-21 01:41+0000\n" +"Last-Translator: enjolras , 2018\n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\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 "Importar extracto bancario" + +#. module: account_bank_statement_import_ofx +#: model:ir.ui.view,arch_db:account_bank_statement_import_ofx.view_account_bank_statement_import_form +msgid "Open Financial Exchange (.OFX Money)" +msgstr "Open Financial Exchange (.OFX Money)" + +#. module: account_bank_statement_import_ofx +#: code:addons/account_bank_statement_import_ofx/wizard/account_bank_statement_import.py:65 +#, python-format +msgid "" +"The following problem occurred during import. The file might not be valid.\n" +"\n" +" %s" +msgstr "" +"Ha ocurrido el siguiente problema durante la importación. El archivo podría no ser válido.\n" +"\n" +"%s" diff --git a/account_bank_statement_import_ofx/i18n/fi.po b/account_bank_statement_import_ofx/i18n/fi.po new file mode 100644 index 0000000..f573e12 --- /dev/null +++ b/account_bank_statement_import_ofx/i18n/fi.po @@ -0,0 +1,38 @@ +# 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" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fi\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\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 "Tuo pankkiaineisto" + +#. module: account_bank_statement_import_ofx +#: model: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:75 +#, python-format +msgid "" +"The following problem occurred during import. The file might not be valid.\n" +"\n" +" %s" +msgstr "" diff --git a/account_bank_statement_import_ofx/i18n/fr.po b/account_bank_statement_import_ofx/i18n/fr.po new file mode 100644 index 0000000..9ce95ee --- /dev/null +++ b/account_bank_statement_import_ofx/i18n/fr.po @@ -0,0 +1,41 @@ +# 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: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\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 "Importer Relevé Bancaire" + +#. module: account_bank_statement_import_ofx +#: model:ir.ui.view,arch_db:account_bank_statement_import_ofx.view_account_bank_statement_import_form +msgid "Open Financial Exchange (.OFX Money)" +msgstr "Open Financial Exchange (.OFX Money)" + +#. module: account_bank_statement_import_ofx +#: code:addons/account_bank_statement_import_ofx/wizard/account_bank_statement_import.py:65 +#, 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" diff --git a/account_bank_statement_import_ofx/i18n/fr_CH.po b/account_bank_statement_import_ofx/i18n/fr_CH.po new file mode 100644 index 0000000..147e888 --- /dev/null +++ b/account_bank_statement_import_ofx/i18n/fr_CH.po @@ -0,0 +1,38 @@ +# 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" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fr_CH\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\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 "Importer Relevé" + +#. module: account_bank_statement_import_ofx +#: model: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:75 +#, python-format +msgid "" +"The following problem occurred during import. The file might not be valid.\n" +"\n" +" %s" +msgstr "" diff --git a/account_bank_statement_import_ofx/i18n/gl.po b/account_bank_statement_import_ofx/i18n/gl.po new file mode 100644 index 0000000..d8ec0d4 --- /dev/null +++ b/account_bank_statement_import_ofx/i18n/gl.po @@ -0,0 +1,38 @@ +# 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" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: gl\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\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 "Importar extracto bancario" + +#. module: account_bank_statement_import_ofx +#: model: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:75 +#, python-format +msgid "" +"The following problem occurred during import. The file might not be valid.\n" +"\n" +" %s" +msgstr "" diff --git a/account_bank_statement_import_ofx/i18n/hr.po b/account_bank_statement_import_ofx/i18n/hr.po new file mode 100644 index 0000000..c1ee5f4 --- /dev/null +++ b/account_bank_statement_import_ofx/i18n/hr.po @@ -0,0 +1,38 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_bank_statement_import_ofx +# +# Translators: +# Bole , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-02-21 01:41+0000\n" +"PO-Revision-Date: 2018-02-21 01:41+0000\n" +"Last-Translator: Bole , 2018\n" +"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: hr\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\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 "Uvoz bankovnog izvoda" + +#. module: account_bank_statement_import_ofx +#: model: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:65 +#, python-format +msgid "" +"The following problem occurred during import. The file might not be valid.\n" +"\n" +" %s" +msgstr "" diff --git a/account_bank_statement_import_ofx/i18n/lt_LT.po b/account_bank_statement_import_ofx/i18n/lt_LT.po new file mode 100644 index 0000000..dd03ac3 --- /dev/null +++ b/account_bank_statement_import_ofx/i18n/lt_LT.po @@ -0,0 +1,41 @@ +# 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" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: lt_LT\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_bank_statement_import_ofx +#: model:ir.model,name:account_bank_statement_import_ofx.model_account_bank_statement_import +msgid "Import Bank Statement" +msgstr "Importuoti banko išrašą" + +#. module: account_bank_statement_import_ofx +#: model: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:65 +#, 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_bank_statement_import_ofx/i18n/nb_NO.po b/account_bank_statement_import_ofx/i18n/nb_NO.po new file mode 100644 index 0000000..e81a792 --- /dev/null +++ b/account_bank_statement_import_ofx/i18n/nb_NO.po @@ -0,0 +1,38 @@ +# 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" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: nb_NO\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\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 "Importer bankutsagn" + +#. module: account_bank_statement_import_ofx +#: model: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:75 +#, python-format +msgid "" +"The following problem occurred during import. The file might not be valid.\n" +"\n" +" %s" +msgstr "" diff --git a/account_bank_statement_import_ofx/i18n/nl.po b/account_bank_statement_import_ofx/i18n/nl.po new file mode 100644 index 0000000..bef900f --- /dev/null +++ b/account_bank_statement_import_ofx/i18n/nl.po @@ -0,0 +1,41 @@ +# 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" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: nl\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\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 "Importeer bankafschrift" + +#. module: account_bank_statement_import_ofx +#: model: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:65 +#, 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_bank_statement_import_ofx/i18n/pt_BR.po b/account_bank_statement_import_ofx/i18n/pt_BR.po new file mode 100644 index 0000000..325d5d2 --- /dev/null +++ b/account_bank_statement_import_ofx/i18n/pt_BR.po @@ -0,0 +1,41 @@ +# 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: 2017-11-21 01:42+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/23907/pt_BR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: pt_BR\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\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 "Importar Extrato Bancário" + +#. module: account_bank_statement_import_ofx +#: model: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:65 +#, 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_bank_statement_import_ofx/i18n/pt_PT.po b/account_bank_statement_import_ofx/i18n/pt_PT.po new file mode 100644 index 0000000..4d00797 --- /dev/null +++ b/account_bank_statement_import_ofx/i18n/pt_PT.po @@ -0,0 +1,38 @@ +# 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" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: pt_PT\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\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 "Importar Extrato Bancário" + +#. module: account_bank_statement_import_ofx +#: model: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:75 +#, python-format +msgid "" +"The following problem occurred during import. The file might not be valid.\n" +"\n" +" %s" +msgstr "" diff --git a/account_bank_statement_import_ofx/i18n/sl.po b/account_bank_statement_import_ofx/i18n/sl.po new file mode 100644 index 0000000..f906c95 --- /dev/null +++ b/account_bank_statement_import_ofx/i18n/sl.po @@ -0,0 +1,41 @@ +# 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" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: sl\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_bank_statement_import_ofx +#: model:ir.model,name:account_bank_statement_import_ofx.model_account_bank_statement_import +msgid "Import Bank Statement" +msgstr "Uvoz bančnega izpiska" + +#. module: account_bank_statement_import_ofx +#: model: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:65 +#, 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_bank_statement_import_ofx/static/description/icon.png b/account_bank_statement_import_ofx/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..c630877c1c5f76912c1e9197d3e688eb2f0e65d4 GIT binary patch literal 6282 zcma)BXHXMLv`(S-AiV_wN|B-@Aiac8yr=|hfJ!%nOAEbAD4}T}u|a6kRFEn`kRC+^ zF+flRK_E1x2Lur@0+0Luy_vT&=bYIyJNskjJMG&{^aWc%J{dj$03dkQ4&`)Y@&5@A z*OBfq^ZamRIKq%;FYz3$cpjgOqdhOq&Ls>0fVBK4zZQB2;Y&y;tGP==RfZq5iDxSwUT$_Da{#MTZEc(e7l}#@?XeMoW=D>q7FDHP!2kqGbq~ z$AY2^!Ry+>05`KyfPT45zsoTqlEr{9%#b$_0wz2ajsUQF?n7E?T4*j zhxFEHaCH93IDZEYs=F*Fa2b$)32js`!n$6eh zi83+*3Iinz#ut+yG$zR-2+)PatWNEJwQ%={t7I>u4?PLUFuYbJwE$dz_nzDr_mE^j zf9uNZ-zIzDZMGrH;;rm|J%l$8X;{RyJ2vug5$7Pxd{Tmi;HJd*#zrIh31@@h{kUTW ze7ts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zfF!#q#|-Z4L6`!xt-h5_(KcQ4s%iidxvi)>a|iW=8F)0B<_I8Hk$Y-fn;@UbR=MRZ zHsq>-Brn|!Zj4P?MaVsv-?gz-GPFou!|KYF40k5+=1a)L@ + + + + + + 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_bank_statement_import_ofx/views/view_account_bank_statement_import.xml b/account_bank_statement_import_ofx/views/view_account_bank_statement_import.xml new file mode 100644 index 0000000..046ed1e --- /dev/null +++ b/account_bank_statement_import_ofx/views/view_account_bank_statement_import.xml @@ -0,0 +1,12 @@ + + + + account.bank.statement.import + + + +
  • Open Financial Exchange (.OFX Money)
  • +
    +
    +
    +
    diff --git a/account_bank_statement_import_ofx/wizard/__init__.py b/account_bank_statement_import_ofx/wizard/__init__.py new file mode 100644 index 0000000..5dfe830 --- /dev/null +++ b/account_bank_statement_import_ofx/wizard/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +from . import account_bank_statement_import diff --git a/account_bank_statement_import_ofx/wizard/account_bank_statement_import.py b/account_bank_statement_import_ofx/wizard/account_bank_statement_import.py new file mode 100644 index 0000000..36760fe --- /dev/null +++ b/account_bank_statement_import_ofx/wizard/account_bank_statement_import.py @@ -0,0 +1,77 @@ +# -*- coding: utf-8 -*- + +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 AccountBankStatementImport(models.TransientModel): + _inherit = 'account.bank.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. + vals = { + 'date': transaction.date, + 'name': transaction.payee + ( + transaction.memo and ': ' + transaction.memo or ''), + 'ref': transaction.id, + '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(AccountBankStatementImport, self)._parse_file( + data_file) + + transactions = [] + total_amt = 0.00 + try: + for transaction in ofx.account.statement.transactions: + vals = self._prepare_ofx_transaction_line(transaction) + if vals: + transactions.append(vals) + total_amt += vals['amount'] + except Exception as e: + raise UserError(_( + "The following problem occurred during import. " + "The file might not be valid.\n\n %s") % e) + + balance = float(ofx.account.statement.balance) + vals_bank_statement = { + 'name': ofx.account.number, + 'transactions': transactions, + 'balance_start': balance - total_amt, + 'balance_end_real': balance, + } + return ofx.account.statement.currency, ofx.account.number, [ + vals_bank_statement]