Browse Source
Merge branch '12.0_PR215' into 12.0_bank_statement_import_test
12.0_bank_statement_import_test
Merge branch '12.0_PR215' into 12.0_bank_statement_import_test
12.0_bank_statement_import_test
Nicolas JEUDY
6 years ago
27 changed files with 930 additions and 0 deletions
-
76account_bank_statement_import_qif/README.rst
-
4account_bank_statement_import_qif/__init__.py
-
23account_bank_statement_import_qif/__manifest__.py
-
37account_bank_statement_import_qif/i18n/account_bank_statement_import_qif.pot
-
42account_bank_statement_import_qif/i18n/de.po
-
43account_bank_statement_import_qif/i18n/es.po
-
42account_bank_statement_import_qif/i18n/fa.po
-
41account_bank_statement_import_qif/i18n/fi.po
-
43account_bank_statement_import_qif/i18n/fr.po
-
42account_bank_statement_import_qif/i18n/fr_CH.po
-
41account_bank_statement_import_qif/i18n/gl.po
-
42account_bank_statement_import_qif/i18n/hr.po
-
43account_bank_statement_import_qif/i18n/lt_LT.po
-
42account_bank_statement_import_qif/i18n/nb_NO.po
-
43account_bank_statement_import_qif/i18n/nl.po
-
42account_bank_statement_import_qif/i18n/pt_BR.po
-
43account_bank_statement_import_qif/i18n/pt_PT.po
-
42account_bank_statement_import_qif/i18n/sl.po
-
3account_bank_statement_import_qif/models/__init__.py
-
13account_bank_statement_import_qif/models/account_journal.py
-
BINaccount_bank_statement_import_qif/static/description/icon.png
-
3account_bank_statement_import_qif/tests/__init__.py
-
49account_bank_statement_import_qif/tests/test_import_bank_statement.py
-
21account_bank_statement_import_qif/tests/test_qif.qif
-
3account_bank_statement_import_qif/wizards/__init__.py
-
93account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py
-
14account_bank_statement_import_qif/wizards/account_bank_statement_import_qif_view.xml
@ -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. |
@ -0,0 +1,4 @@ |
|||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
||||
|
|
||||
|
from . import models |
||||
|
from . import wizards |
@ -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', |
||||
|
} |
@ -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 "" |
||||
|
|
@ -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." |
@ -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." |
@ -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 "?????? ???????? ???? ???????????? ?????????? ???????? ???? ???? ?????????? ?????? ?????? ????????." |
@ -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 "" |
@ -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." |
@ -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 "" |
@ -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 "" |
@ -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 "" |
@ -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." |
@ -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 "" |
@ -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." |
@ -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." |
@ -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." |
@ -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." |
@ -0,0 +1,3 @@ |
|||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
||||
|
|
||||
|
from . import account_journal |
@ -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 |
After Width: 128 | Height: 128 | Size: 6.0 KiB |
@ -0,0 +1,3 @@ |
|||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
||||
|
|
||||
|
from . import test_import_bank_statement |
@ -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) |
@ -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 |
||||
|
^ |
@ -0,0 +1,3 @@ |
|||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
||||
|
|
||||
|
from . import account_bank_statement_import_qif |
@ -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 |
@ -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> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue