Browse Source

Merge branch '12.0_PR215' into 12.0_bank_statement_import_test

12.0_bank_statement_import_test
Nicolas JEUDY 5 years ago
parent
commit
993a874aa2
  1. 76
      account_bank_statement_import_qif/README.rst
  2. 4
      account_bank_statement_import_qif/__init__.py
  3. 23
      account_bank_statement_import_qif/__manifest__.py
  4. 37
      account_bank_statement_import_qif/i18n/account_bank_statement_import_qif.pot
  5. 42
      account_bank_statement_import_qif/i18n/de.po
  6. 43
      account_bank_statement_import_qif/i18n/es.po
  7. 42
      account_bank_statement_import_qif/i18n/fa.po
  8. 41
      account_bank_statement_import_qif/i18n/fi.po
  9. 43
      account_bank_statement_import_qif/i18n/fr.po
  10. 42
      account_bank_statement_import_qif/i18n/fr_CH.po
  11. 41
      account_bank_statement_import_qif/i18n/gl.po
  12. 42
      account_bank_statement_import_qif/i18n/hr.po
  13. 43
      account_bank_statement_import_qif/i18n/lt_LT.po
  14. 42
      account_bank_statement_import_qif/i18n/nb_NO.po
  15. 43
      account_bank_statement_import_qif/i18n/nl.po
  16. 42
      account_bank_statement_import_qif/i18n/pt_BR.po
  17. 43
      account_bank_statement_import_qif/i18n/pt_PT.po
  18. 42
      account_bank_statement_import_qif/i18n/sl.po
  19. 3
      account_bank_statement_import_qif/models/__init__.py
  20. 13
      account_bank_statement_import_qif/models/account_journal.py
  21. BIN
      account_bank_statement_import_qif/static/description/icon.png
  22. 3
      account_bank_statement_import_qif/tests/__init__.py
  23. 49
      account_bank_statement_import_qif/tests/test_import_bank_statement.py
  24. 21
      account_bank_statement_import_qif/tests/test_qif.qif
  25. 3
      account_bank_statement_import_qif/wizards/__init__.py
  26. 93
      account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py
  27. 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.

4
account_bank_statement_import_qif/__init__.py

@ -0,0 +1,4 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import models
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': '12.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',
}

37
account_bank_statement_import_qif/i18n/account_bank_statement_import_qif.pot

@ -0,0 +1,37 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_bank_statement_import_qif
#
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_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:34
#, 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 ""
#. 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:69
#, python-format
msgid "This file is either not a bank statement or is not correctly formed."
msgstr ""

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 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-12-17 03:38+0000\n"
"PO-Revision-Date: 2017-12-17 03:38+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 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_bank_statement_import_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:34
#, 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:69
#, 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."

43
account_bank_statement_import_qif/i18n/es.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
# Pedro M. Baeza <pedro.baeza@gmail.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-12-17 03:38+0000\n"
"PO-Revision-Date: 2017-12-17 03:38+0000\n"
"Last-Translator: Pedro M. Baeza <pedro.baeza@gmail.com>, 2017\n"
"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/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"
#. module: account_bank_statement_import_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:34
#, 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 "Quicken Interchange Format (.qif)"
#. module: account_bank_statement_import_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:69
#, 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."

42
account_bank_statement_import_qif/i18n/fa.po

@ -0,0 +1,42 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_bank_statement_import_qif
#
# Translators:
# Mehdi Zarrinkolah <mehdi1811@gmail.com>, 2018
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-08 08:27+0000\n"
"PO-Revision-Date: 2018-07-22 11:31+0000\n"
"Last-Translator: derKonig <fshahy@gmail.com>\n"
"Language-Team: Persian (https://www.transifex.com/oca/teams/23907/fa/)\n"
"Language: fa\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 3.0.1\n"
#. module: account_bank_statement_import_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:34
#, python-format
msgid "Could not decipher the QIF file."
msgstr "???????? 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 "???????? ???????????? ??????????"
#. 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 "???????? ???????????? ???????? (.qif)"
#. module: account_bank_statement_import_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:69
#, python-format
msgid "This file is either not a bank statement or is not correctly formed."
msgstr "?????? ???????? ???? ???????????? ?????????? ???????? ???? ???? ?????????? ?????? ?????? ????????."

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"
"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_bank_statement_import_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:34
#, 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:69
#, python-format
msgid "This file is either not a bank statement or is not correctly formed."
msgstr ""

43
account_bank_statement_import_qif/i18n/fr.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
# Lixon Jean-Yves <jy.lixon@ls-development.net>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-03-21 03:39+0000\n"
"PO-Revision-Date: 2018-03-21 03:39+0000\n"
"Last-Translator: Lixon Jean-Yves <jy.lixon@ls-development.net>, 2017\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"
#. module: account_bank_statement_import_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:34
#, 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 un 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 "Format d'??change avec Quicken (.qif)"
#. module: account_bank_statement_import_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:69
#, 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."

42
account_bank_statement_import_qif/i18n/fr_CH.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>, 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"
"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_bank_statement_import_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:34
#, 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:69
#, 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"
"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_bank_statement_import_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:34
#, 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:69
#, python-format
msgid "This file is either not a bank statement or is not correctly formed."
msgstr ""

42
account_bank_statement_import_qif/i18n/hr.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>, 2018
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-08 08:27+0000\n"
"PO-Revision-Date: 2018-06-08 08:27+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2018\n"
"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n"
"Language: hr\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"
"%10<=4 && (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:34
#, 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 "Uvoz bankovnog izvoda"
#. 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:69
#, python-format
msgid "This file is either not a bank statement or is not correctly formed."
msgstr ""

43
account_bank_statement_import_qif/i18n/lt_LT.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 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-12-17 03:38+0000\n"
"PO-Revision-Date: 2017-12-17 03:38+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"
"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_bank_statement_import_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:34
#, 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:69
#, 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."

42
account_bank_statement_import_qif/i18n/nb_NO.po

@ -0,0 +1,42 @@
# 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"
"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_bank_statement_import_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:34
#, 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:69
#, 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 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-12-17 03:38+0000\n"
"PO-Revision-Date: 2017-12-17 03:38+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\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_bank_statement_import_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:34
#, 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:69
#, 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."

42
account_bank_statement_import_qif/i18n/pt_BR.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 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-12-17 03:38+0000\n"
"PO-Revision-Date: 2017-12-17 03:38+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"
"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"
#. module: account_bank_statement_import_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:34
#, 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:69
#, 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."

43
account_bank_statement_import_qif/i18n/pt_PT.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 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-12-17 03:38+0000\n"
"PO-Revision-Date: 2017-12-17 03:38+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"
"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_bank_statement_import_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:34
#, 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:69
#, 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."

42
account_bank_statement_import_qif/i18n/sl.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 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-12-17 03:38+0000\n"
"PO-Revision-Date: 2017-12-17 03:38+0000\n"
"Last-Translator: OCA Transbot <transbot@odoo-community.org>, 2017\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_bank_statement_import_qif
#: code:addons/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py:34
#, 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:69
#, 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."

3
account_bank_statement_import_qif/models/__init__.py

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

13
account_bank_statement_import_qif/models/account_journal.py

@ -0,0 +1,13 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import models, _
class AccountJournal(models.Model):
_inherit = "account.journal"
def _get_bank_statements_available_import_formats(self):
res = super(AccountJournal, self).\
_get_bank_statements_available_import_formats()
res.extend([_('.qif')])
return res

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 in ("Bank", "CCard"):
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] == '^' and vals_line: # 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