Browse Source

Merge pull request #129 from Tecnativa/11.0-account_bank_statement_import_qif

[11.0][MIG] account_bank_statement_import_qif: Migration to 11.0
pull/141/head
Pedro M. Baeza 7 years ago
committed by GitHub
parent
commit
d7399245f3
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 76
      account_bank_statement_import_qif/README.rst
  2. 3
      account_bank_statement_import_qif/__init__.py
  3. 23
      account_bank_statement_import_qif/__manifest__.py
  4. 42
      account_bank_statement_import_qif/i18n/de.po
  5. 42
      account_bank_statement_import_qif/i18n/es.po
  6. 41
      account_bank_statement_import_qif/i18n/fi.po
  7. 44
      account_bank_statement_import_qif/i18n/fr.po
  8. 41
      account_bank_statement_import_qif/i18n/fr_CH.po
  9. 41
      account_bank_statement_import_qif/i18n/gl.po
  10. 41
      account_bank_statement_import_qif/i18n/lt_LT.po
  11. 41
      account_bank_statement_import_qif/i18n/nb_NO.po
  12. 43
      account_bank_statement_import_qif/i18n/nl.po
  13. 41
      account_bank_statement_import_qif/i18n/pt_BR.po
  14. 42
      account_bank_statement_import_qif/i18n/pt_PT.po
  15. 41
      account_bank_statement_import_qif/i18n/sl.po
  16. BIN
      account_bank_statement_import_qif/static/description/icon.png
  17. 3
      account_bank_statement_import_qif/tests/__init__.py
  18. 49
      account_bank_statement_import_qif/tests/test_import_bank_statement.py
  19. 21
      account_bank_statement_import_qif/tests/test_qif.qif
  20. 3
      account_bank_statement_import_qif/wizards/__init__.py
  21. 93
      account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py
  22. 14
      account_bank_statement_import_qif/wizards/account_bank_statement_import_qif_view.xml

76
account_bank_statement_import_qif/README.rst

@ -0,0 +1,76 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
==========================
Import QIF bank statements
==========================
This module allows you to import the machine readable QIF Files in Odoo: they
are parsed and stored in human readable format in
Accounting \ Bank and Cash \ Bank Statements.
Important Note
--------------
Because of the QIF format limitation, we cannot ensure the same transactions
aren't imported several times or handle multicurrency. Whenever possible, you
should use a more appropriate file format like OFX.
The module was initiated as a backport of the new framework developed
by Odoo for V9 at its early stage. As Odoo has relicensed this module as
private inside its Odoo enterprise layer, now this one is maintained from the
original AGPL code.
Usage
=====
To use this module, you need to:
#. Go to *Invoicing / Accounting* dashboard.
#. Click on *Import statement* from any of the bank journals.
#. Select a QIF file.
#. Press *Import*.
.. 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/11.0
Bug Tracker
===========
Bugs are tracked on
`GitHub Issues <https://github.com/OCA/bank-statement-import/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
* Akretion
* Alexis de Lattre <alexis@via.ecp.fr>
* ACSONE A/V
* Laurent Mignon <laurent.mignon@acsone.eu>
* Therp
* Ronald Portier <rportier@therp.nl>
* Tecnativa (https://www.tecnativa.com)
* Pedro M. Baeza <pedro.baeza@tecnativa.com>
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.

3
account_bank_statement_import_qif/__init__.py

@ -0,0 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import wizards

23
account_bank_statement_import_qif/__manifest__.py

@ -0,0 +1,23 @@
# Copyright 2015 Odoo S. A.
# Copyright 2015 Laurent Mignon <laurent.mignon@acsone.eu>
# Copyright 2015 Ronald Portier <rportier@therp.nl>
# Copyright 2016-2017 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Import QIF Bank Statements',
'category': 'Accounting',
'version': '11.0.1.0.0',
'author': 'OpenERP SA,'
'Tecnativa,'
'Odoo Community Association (OCA)',
'website': 'https://github.com/OCA/bank-statement-import',
'depends': [
'account_bank_statement_import',
],
'data': [
'wizards/account_bank_statement_import_qif_view.xml',
],
'installable': True,
'license': 'AGPL-3',
}

42
account_bank_statement_import_qif/i18n/de.po

@ -0,0 +1,42 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_bank_statement_import_qif
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 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 <transbot@odoo-community.org>, 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_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:38
#, python-format
msgid "Could not decipher the QIF file."
msgstr "Konnte QIF-Datei nicht entziffern."
#. module: account_bank_statement_import_qif
#: model:ir.model,name:account_bank_statement_import_qif.model_account_bank_statement_import
msgid "Import Bank Statement"
msgstr "Kontoauszug importieren"
#. module: account_bank_statement_import_qif
#: model:ir.ui.view,arch_db:account_bank_statement_import_qif.account_bank_statement_import_view
msgid "Quicken Interchange Format (.qif)"
msgstr "Quicken Interchange Format (.qif)"
#. module: account_bank_statement_import_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:73
#, python-format
msgid "This file is either not a bank statement or is not correctly formed."
msgstr ""
"Diese Datei ist entweder kein Kontoauszug oder ist fehlerhaft formatiert."

42
account_bank_statement_import_qif/i18n/es.po

@ -0,0 +1,42 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_bank_statement_import_qif
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 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 <transbot@odoo-community.org>, 2017\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_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:38
#, python-format
msgid "Could not decipher the QIF file."
msgstr "No se puede descifrar el archivo QIF."
#. module: account_bank_statement_import_qif
#: model:ir.model,name:account_bank_statement_import_qif.model_account_bank_statement_import
msgid "Import Bank Statement"
msgstr "Importar extracto bancario"
#. module: account_bank_statement_import_qif
#: model:ir.ui.view,arch_db:account_bank_statement_import_qif.account_bank_statement_import_view
msgid "Quicken Interchange Format (.qif)"
msgstr ""
#. module: account_bank_statement_import_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:73
#, python-format
msgid "This file is either not a bank statement or is not correctly formed."
msgstr ""
"Este archivo no es un extracto bancario o no está correctamente formado."

41
account_bank_statement_import_qif/i18n/fi.po

@ -0,0 +1,41 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_bank_statement_import_qif
#
# Translators:
# Jarmo Kortetjärvi <jarmo.kortetjarvi@gmail.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-12-10 05:00+0000\n"
"PO-Revision-Date: 2016-12-10 05:00+0000\n"
"Last-Translator: Jarmo Kortetjärvi <jarmo.kortetjarvi@gmail.com>, 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_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:39
#, python-format
msgid "Could not decipher the QIF file."
msgstr ""
#. module: account_bank_statement_import_qif
#: model:ir.model,name:account_bank_statement_import_qif.model_account_bank_statement_import
msgid "Import Bank Statement"
msgstr "Tuo pankkiaineisto"
#. module: account_bank_statement_import_qif
#: model:ir.ui.view,arch_db:account_bank_statement_import_qif.account_bank_statement_import_view
msgid "Quicken Interchange Format (.qif)"
msgstr ""
#. module: account_bank_statement_import_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:74
#, python-format
msgid "This file is either not a bank statement or is not correctly formed."
msgstr ""

44
account_bank_statement_import_qif/i18n/fr.po

@ -0,0 +1,44 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_bank_statement_import_qif
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2017
# Quentin THEURET <odoo@kerpeo.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-08-11 02:41+0000\n"
"PO-Revision-Date: 2017-08-11 02:41+0000\n"
"Last-Translator: Quentin THEURET <odoo@kerpeo.com>, 2017\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_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:38
#, python-format
msgid "Could not decipher the QIF file."
msgstr "Impossible de déchiffrer le fichier QIF."
#. module: account_bank_statement_import_qif
#: model:ir.model,name:account_bank_statement_import_qif.model_account_bank_statement_import
msgid "Import Bank Statement"
msgstr "Importer Relevé Bancaire"
#. module: account_bank_statement_import_qif
#: model:ir.ui.view,arch_db:account_bank_statement_import_qif.account_bank_statement_import_view
msgid "Quicken Interchange Format (.qif)"
msgstr "Quicken Interchange Format (.qif)"
#. module: account_bank_statement_import_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:73
#, python-format
msgid "This file is either not a bank statement or is not correctly formed."
msgstr ""
"Ce fichier n'est pas un relevé bancaire ou n'est pas dans un format "
"correcte."

41
account_bank_statement_import_qif/i18n/fr_CH.po

@ -0,0 +1,41 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_bank_statement_import_qif
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-12-09 17:00+0000\n"
"PO-Revision-Date: 2016-12-09 17:00+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2016\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_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:39
#, python-format
msgid "Could not decipher the QIF file."
msgstr ""
#. module: account_bank_statement_import_qif
#: model:ir.model,name:account_bank_statement_import_qif.model_account_bank_statement_import
msgid "Import Bank Statement"
msgstr "Importer Relevé"
#. module: account_bank_statement_import_qif
#: model:ir.ui.view,arch_db:account_bank_statement_import_qif.account_bank_statement_import_view
msgid "Quicken Interchange Format (.qif)"
msgstr ""
#. module: account_bank_statement_import_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:74
#, python-format
msgid "This file is either not a bank statement or is not correctly formed."
msgstr ""

41
account_bank_statement_import_qif/i18n/gl.po

@ -0,0 +1,41 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_bank_statement_import_qif
#
# Translators:
# Alejandro Santana <alejandrosantana@anubia.es>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-12-09 17:00+0000\n"
"PO-Revision-Date: 2016-12-09 17:00+0000\n"
"Last-Translator: Alejandro Santana <alejandrosantana@anubia.es>, 2016\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_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:39
#, python-format
msgid "Could not decipher the QIF file."
msgstr ""
#. module: account_bank_statement_import_qif
#: model:ir.model,name:account_bank_statement_import_qif.model_account_bank_statement_import
msgid "Import Bank Statement"
msgstr "Importar extracto bancario"
#. module: account_bank_statement_import_qif
#: model:ir.ui.view,arch_db:account_bank_statement_import_qif.account_bank_statement_import_view
msgid "Quicken Interchange Format (.qif)"
msgstr ""
#. module: account_bank_statement_import_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:74
#, python-format
msgid "This file is either not a bank statement or is not correctly formed."
msgstr ""

41
account_bank_statement_import_qif/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_qif
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 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 <transbot@odoo-community.org>, 2017\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_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:38
#, python-format
msgid "Could not decipher the QIF file."
msgstr "Neįmanoma iššifruoti QIF failo."
#. module: account_bank_statement_import_qif
#: model:ir.model,name:account_bank_statement_import_qif.model_account_bank_statement_import
msgid "Import Bank Statement"
msgstr "Importuoti banko išrašą"
#. module: account_bank_statement_import_qif
#: model:ir.ui.view,arch_db:account_bank_statement_import_qif.account_bank_statement_import_view
msgid "Quicken Interchange Format (.qif)"
msgstr ""
#. module: account_bank_statement_import_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:73
#, python-format
msgid "This file is either not a bank statement or is not correctly formed."
msgstr "Failas arba ne banko išrašas arba suformuotas neteisingai."

41
account_bank_statement_import_qif/i18n/nb_NO.po

@ -0,0 +1,41 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_bank_statement_import_qif
#
# Translators:
# Imre Kristoffer Eilertsen <imreeil42@gmail.com>, 2016
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-12-09 17:00+0000\n"
"PO-Revision-Date: 2016-12-09 17:00+0000\n"
"Last-Translator: Imre Kristoffer Eilertsen <imreeil42@gmail.com>, 2016\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_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:39
#, python-format
msgid "Could not decipher the QIF file."
msgstr ""
#. module: account_bank_statement_import_qif
#: model:ir.model,name:account_bank_statement_import_qif.model_account_bank_statement_import
msgid "Import Bank Statement"
msgstr "Importer bankutsagn"
#. module: account_bank_statement_import_qif
#: model:ir.ui.view,arch_db:account_bank_statement_import_qif.account_bank_statement_import_view
msgid "Quicken Interchange Format (.qif)"
msgstr ""
#. module: account_bank_statement_import_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:74
#, python-format
msgid "This file is either not a bank statement or is not correctly formed."
msgstr ""

43
account_bank_statement_import_qif/i18n/nl.po

@ -0,0 +1,43 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_bank_statement_import_qif
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 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 <transbot@odoo-community.org>, 2017\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_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:38
#, python-format
msgid "Could not decipher the QIF file."
msgstr "Kon het QIF bestand niet ontcijferen."
#. module: account_bank_statement_import_qif
#: model:ir.model,name:account_bank_statement_import_qif.model_account_bank_statement_import
msgid "Import Bank Statement"
msgstr "Importeer bankafschrift"
#. module: account_bank_statement_import_qif
#: model:ir.ui.view,arch_db:account_bank_statement_import_qif.account_bank_statement_import_view
msgid "Quicken Interchange Format (.qif)"
msgstr ""
#. module: account_bank_statement_import_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:73
#, python-format
msgid "This file is either not a bank statement or is not correctly formed."
msgstr ""
"Het bestand is of geen bankafschrift bestand of het bestand is niet in het "
"correcte formaat."

41
account_bank_statement_import_qif/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_qif
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 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 <transbot@odoo-community.org>, 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_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:38
#, python-format
msgid "Could not decipher the QIF file."
msgstr "Não foi possível decifrar o arquivo QIF."
#. module: account_bank_statement_import_qif
#: model:ir.model,name:account_bank_statement_import_qif.model_account_bank_statement_import
msgid "Import Bank Statement"
msgstr "Importar Extrato Bancário"
#. module: account_bank_statement_import_qif
#: model:ir.ui.view,arch_db:account_bank_statement_import_qif.account_bank_statement_import_view
msgid "Quicken Interchange Format (.qif)"
msgstr ""
#. module: account_bank_statement_import_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:73
#, python-format
msgid "This file is either not a bank statement or is not correctly formed."
msgstr "O arquivo não é um extrato bancário ou o formato é incorreto."

42
account_bank_statement_import_qif/i18n/pt_PT.po

@ -0,0 +1,42 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_bank_statement_import_qif
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 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 <transbot@odoo-community.org>, 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_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:38
#, python-format
msgid "Could not decipher the QIF file."
msgstr "Não foi possível decifrar o ficheiro QIF."
#. module: account_bank_statement_import_qif
#: model:ir.model,name:account_bank_statement_import_qif.model_account_bank_statement_import
msgid "Import Bank Statement"
msgstr "Importar Extrato Bancário"
#. module: account_bank_statement_import_qif
#: model:ir.ui.view,arch_db:account_bank_statement_import_qif.account_bank_statement_import_view
msgid "Quicken Interchange Format (.qif)"
msgstr ""
#. module: account_bank_statement_import_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:73
#, python-format
msgid "This file is either not a bank statement or is not correctly formed."
msgstr ""
"O ficheiro não é um extrato bancário ou não está corretamente formatado."

41
account_bank_statement_import_qif/i18n/sl.po

@ -0,0 +1,41 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_bank_statement_import_qif
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 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 <transbot@odoo-community.org>, 2017\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_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:38
#, python-format
msgid "Could not decipher the QIF file."
msgstr "QIF datoteke ni bilo mogoče dešifrirati."
#. module: account_bank_statement_import_qif
#: model:ir.model,name:account_bank_statement_import_qif.model_account_bank_statement_import
msgid "Import Bank Statement"
msgstr "Uvoz bančnega izpiska"
#. module: account_bank_statement_import_qif
#: model:ir.ui.view,arch_db:account_bank_statement_import_qif.account_bank_statement_import_view
msgid "Quicken Interchange Format (.qif)"
msgstr ""
#. module: account_bank_statement_import_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:73
#, python-format
msgid "This file is either not a bank statement or is not correctly formed."
msgstr "Ta datoteka ni bančni izpisek, ali pa ni pravilno oblikovana."

BIN
account_bank_statement_import_qif/static/description/icon.png

After

Width: 128  |  Height: 128  |  Size: 6.0 KiB

3
account_bank_statement_import_qif/tests/__init__.py

@ -0,0 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import test_import_bank_statement

49
account_bank_statement_import_qif/tests/test_import_bank_statement.py

@ -0,0 +1,49 @@
# Copyright 2015 Odoo S. A.
# Copyright 2015 Laurent Mignon <laurent.mignon@acsone.eu>
# Copyright 2015 Ronald Portier <rportier@therp.nl>
# Copyright 2016-2017 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo.tests.common import TransactionCase
from odoo.modules.module import get_module_resource
import base64
class TestQifFile(TransactionCase):
"""Tests for import bank statement qif file format
(account.bank.statement.import)
"""
def setUp(self):
super(TestQifFile, self).setUp()
self.statement_import_model = self.env['account.bank.statement.import']
self.statement_line_model = self.env['account.bank.statement.line']
self.journal = self.env['account.journal'].create({
'name': 'Test bank journal',
'code': 'TEST',
'type': 'bank',
})
self.partner = self.env['res.partner'].create({
# Different case for trying insensitive case search
'name': 'EPIC Technologies',
})
def test_qif_file_import(self):
qif_file_path = get_module_resource(
'account_bank_statement_import_qif', 'tests', 'test_qif.qif',
)
qif_file = base64.b64encode(open(qif_file_path, 'rb').read())
wizard = self.statement_import_model.with_context(
journal_id=self.journal.id
).create(
dict(data_file=qif_file)
)
wizard.import_file()
statement = self.statement_line_model.search(
[('name', '=', 'YOUR LOCAL SUPERMARKET')], limit=1,
)[0].statement_id
self.assertAlmostEqual(statement.balance_end_real, -1896.09, 2)
line = self.statement_line_model.search(
[('name', '=', 'Epic Technologies')], limit=1,
)
self.assertEqual(line.partner_id, self.partner)

21
account_bank_statement_import_qif/tests/test_qif.qif

@ -0,0 +1,21 @@
!Type:Bank
D8/12/13
T-1,000.00
PDelta PC
^
D8/15/13
T-75.46
PWalts Drugs
^
D3/3/13
T-379.00
PEpic Technologies
^
D3/4/13
T-20.28
PYOUR LOCAL SUPERMARKET
^
D3/3/13
T-421.35
PSPRINGFIELD WATER UTILITY
^

3
account_bank_statement_import_qif/wizards/__init__.py

@ -0,0 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import account_bank_statement_import_qif

93
account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py

@ -0,0 +1,93 @@
# Copyright 2015 Odoo S. A.
# Copyright 2015 Laurent Mignon <laurent.mignon@acsone.eu>
# Copyright 2015 Ronald Portier <rportier@therp.nl>
# Copyright 2016-2017 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import dateutil.parser
from odoo.tools.translate import _
from odoo import api, models
from odoo.exceptions import UserError
class AccountBankStatementImport(models.TransientModel):
_inherit = "account.bank.statement.import"
@api.model
def _check_qif(self, data_file):
return data_file.strip().startswith(b'!Type:')
def _parse_file(self, data_file):
if not self._check_qif(data_file):
return super(AccountBankStatementImport, self)._parse_file(
data_file)
try:
file_data = data_file.decode()
if '\r' in file_data:
data_list = file_data.split('\r')
else:
data_list = file_data.split('\n')
header = data_list[0].strip()
header = header.split(":")[1]
except:
raise UserError(_('Could not decipher the QIF file.'))
transactions = []
vals_line = {}
total = 0
if header == "Bank":
vals_bank_statement = {}
for line in data_list:
line = line.strip()
if not line:
continue
if line[0] == 'D': # date of transaction
vals_line['date'] = dateutil.parser.parse(
line[1:], fuzzy=True).date()
elif line[0] == 'T': # Total amount
total += float(line[1:].replace(',', ''))
vals_line['amount'] = float(line[1:].replace(',', ''))
elif line[0] == 'N': # Check number
vals_line['ref'] = line[1:]
elif line[0] == 'P': # Payee
vals_line['name'] = (
'name' in vals_line and
line[1:] + ': ' + vals_line['name'] or line[1:]
)
elif line[0] == 'M': # Memo
vals_line['name'] = ('name' in vals_line and
vals_line['name'] + ': ' + line[1:] or
line[1:])
elif line[0] == '^': # end of item
transactions.append(vals_line)
vals_line = {}
elif line[0] == '\n':
transactions = []
else:
pass
else:
raise UserError(_('This file is either not a bank statement or is '
'not correctly formed.'))
vals_bank_statement.update({
'balance_end_real': total,
'transactions': transactions
})
return None, None, [vals_bank_statement]
def _complete_stmts_vals(self, stmt_vals, journal_id, account_number):
"""Match partner_id if hasn't been deducted yet."""
res = super(AccountBankStatementImport, self)._complete_stmts_vals(
stmt_vals, journal_id, account_number,
)
# Since QIF doesn't provide account numbers (normal behaviour is to
# provide 'account_number', which the generic module uses to find
# the partner), we have to find res.partner through the name
partner_obj = self.env['res.partner']
for statement in res:
for line_vals in statement['transactions']:
if not line_vals.get('partner_id') and line_vals.get('name'):
partner = partner_obj.search(
[('name', 'ilike', line_vals['name'])], limit=1,
)
line_vals['partner_id'] = partner.id
return res

14
account_bank_statement_import_qif/wizards/account_bank_statement_import_qif_view.xml

@ -0,0 +1,14 @@
<?xml version="1.0" ?>
<odoo>
<record id="account_bank_statement_import_view" model="ir.ui.view">
<field name="model">account.bank.statement.import</field>
<field name="inherit_id" ref="account_bank_statement_import.account_bank_statement_import_view"/>
<field name="arch" type="xml">
<xpath expr="//ul[@id='statement_format']" position="inside">
<li>Quicken Interchange Format (.qif)</li>
</xpath>
</field>
</record>
</odoo>
Loading…
Cancel
Save