diff --git a/account_bank_statement_import_save_file/README.rst b/account_bank_statement_import_save_file/README.rst index 37ff0bf..249b8e2 100644 --- a/account_bank_statement_import_save_file/README.rst +++ b/account_bank_statement_import_save_file/README.rst @@ -1,3 +1,8 @@ +.. 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 + +============================ Save imported statement file ============================ @@ -8,28 +13,41 @@ Usage On a successful import, the generated statement(s) link to an attachment containing the original file. +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smash it by providing detailed and welcomed feedback. + Credits ======= + +Images +------ + +* Odoo Community Association: `Icon `_. + Contributors ------------ * Holger Brunn - -Icon ----- - -* https://commons.wikimedia.org/wiki/File:Paper_clip_font_awesome.svg +* Mourad EL HADJ MIMOUNE Maintainer ---------- -.. image:: http://odoo-community.org/logo.png - :alt: Odoo Community Association - :target: http://odoo-community.org + +.. 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. +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 http://odoo-community.org. +To contribute to this module, please visit https://odoo-community.org. \ No newline at end of file diff --git a/account_bank_statement_import_save_file/__init__.py b/account_bank_statement_import_save_file/__init__.py index a1813e6..d0b326e 100644 --- a/account_bank_statement_import_save_file/__init__.py +++ b/account_bank_statement_import_save_file/__init__.py @@ -1,22 +1,6 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# This module copyright (C) 2015 Therp BV . -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# © 2015 Therp BV (). +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + from . import models from .hooks import _post_init_hook diff --git a/account_bank_statement_import_save_file/__manifest__.py b/account_bank_statement_import_save_file/__manifest__.py index 9cabc98..91347c2 100644 --- a/account_bank_statement_import_save_file/__manifest__.py +++ b/account_bank_statement_import_save_file/__manifest__.py @@ -1,45 +1,22 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# This module copyright (C) 2015 Therp BV . -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# © 2015 Therp BV (). +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + { - "name": "Save imported bank statements", - "version": "8.0.1.0.0", - "author": "Therp BV", - "license": "AGPL-3", - "category": "Accounting & Finance", - "summary": "Keep imported bank statements as raw data", - "depends": [ + 'name': 'Save imported bank statements', + 'version': '10.0.1.0.0', + 'author': 'Odoo Community Association (OCA), Therp BV', + 'license': 'AGPL-3', + 'category': 'Banking addons', + 'summary': 'Keep imported bank statements as raw data', + 'depends': [ 'account_bank_statement_import', ], - "data": [ - "views/account_bank_statement.xml", + 'data': [ + 'views/account_bank_statement.xml', ], - "qweb": [ - ], - "test": [ - ], - "post_init_hook": '_post_init_hook', - "auto_install": False, - 'installable': False, - "application": False, - "external_dependencies": { - 'python': [], - }, + 'post_init_hook': '_post_init_hook', + 'auto_install': False, + 'installable': True, + 'application': False, } diff --git a/account_bank_statement_import_save_file/hooks.py b/account_bank_statement_import_save_file/hooks.py index 908c225..f2b8fd3 100644 --- a/account_bank_statement_import_save_file/hooks.py +++ b/account_bank_statement_import_save_file/hooks.py @@ -1,24 +1,6 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# This module copyright (C) 2015 Therp BV . -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## -from openerp import SUPERUSER_ID +# © 2015 Therp BV (). +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). def _post_init_hook(cr, pool): @@ -56,6 +38,9 @@ def _post_init_hook_migrate_account_banking_imported_file(cr, pool): attachment_ids = [attachment_id for attachment_id, in cr.fetchall()] + if not attachment_ids: + return + # assign respective attachment to all statements pointing to an imported # banking file cr.execute( @@ -86,7 +71,6 @@ def _post_init_hook_migrate_account_banking_imported_file(cr, pool): (tuple(attachment_ids),) ) for attachment_id, content in cr.fetchall(): - pool['ir.attachment'].write( - cr, SUPERUSER_ID, + pool['ir.attachment'].sudo().write( [attachment_id], {'datas': str(content)}) diff --git a/account_bank_statement_import_save_file/i18n/de.po b/account_bank_statement_import_save_file/i18n/de.po new file mode 100644 index 0000000..370e85c --- /dev/null +++ b/account_bank_statement_import_save_file/i18n/de.po @@ -0,0 +1,54 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_bank_statement_import_save_file +# +# Translators: +# Rudolf Schnapka , 2015 +msgid "" +msgstr "" +"Project-Id-Version: bank-statement-import (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-03-04 01:15+0000\n" +"PO-Revision-Date: 2017-03-06 19:00+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: German (http://www.transifex.com/oca/OCA-bank-statement-import-8-0/language/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_save_file +#: model:ir.model,name:account_bank_statement_import_save_file.model_account_bank_statement +msgid "Bank Statement" +msgstr "Kontoauszug" + +#. module: account_bank_statement_import_save_file +#: field:account.bank.statement,import_date:0 +msgid "Date Created" +msgstr "" + +#. module: account_bank_statement_import_save_file +#: field:account.bank.statement,import_log:0 +msgid "Description" +msgstr "Beschreibung" + +#. module: account_bank_statement_import_save_file +#: model:ir.model,name:account_bank_statement_import_save_file.model_account_bank_statement_import +msgid "Import Bank Statement" +msgstr "Kontoauszug importieren" + +#. module: account_bank_statement_import_save_file +#: field:account.bank.statement,import_file:0 +msgid "Import file" +msgstr "Datei importieren" + +#. module: account_bank_statement_import_save_file +#: view:account.bank.statement:account_bank_statement_import_save_file.view_bank_statement_form +msgid "Imported file" +msgstr "Importierte Datei" + +#. module: account_bank_statement_import_save_file +#: field:account.bank.statement,import_user:0 +msgid "Owner" +msgstr "Besitzer" diff --git a/account_bank_statement_import_save_file/i18n/es.po b/account_bank_statement_import_save_file/i18n/es.po index 7aebef5..1216aed 100644 --- a/account_bank_statement_import_save_file/i18n/es.po +++ b/account_bank_statement_import_save_file/i18n/es.po @@ -3,13 +3,15 @@ # * account_bank_statement_import_save_file # # Translators: +# Antonio Trueba, 2016 +# Antonio Trueba, 2016 msgid "" msgstr "" "Project-Id-Version: bank-statement-import (8.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-09-01 16:24+0000\n" -"PO-Revision-Date: 2015-09-01 16:25+0000\n" -"Last-Translator: <>\n" +"POT-Creation-Date: 2016-12-14 13:07+0000\n" +"PO-Revision-Date: 2016-12-22 09:16+0000\n" +"Last-Translator: OCA Transbot \n" "Language-Team: Spanish (http://www.transifex.com/oca/OCA-bank-statement-import-8-0/language/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -20,8 +22,18 @@ msgstr "" #. module: account_bank_statement_import_save_file #: model:ir.model,name:account_bank_statement_import_save_file.model_account_bank_statement msgid "Bank Statement" +msgstr "Extracto bancario" + +#. module: account_bank_statement_import_save_file +#: field:account.bank.statement,import_date:0 +msgid "Date Created" msgstr "" +#. module: account_bank_statement_import_save_file +#: field:account.bank.statement,import_log:0 +msgid "Description" +msgstr "Descripción" + #. module: account_bank_statement_import_save_file #: model:ir.model,name:account_bank_statement_import_save_file.model_account_bank_statement_import msgid "Import Bank Statement" @@ -30,9 +42,14 @@ msgstr "Importar extracto bancario" #. module: account_bank_statement_import_save_file #: field:account.bank.statement,import_file:0 msgid "Import file" -msgstr "" +msgstr "Importar archivo" #. module: account_bank_statement_import_save_file #: view:account.bank.statement:account_bank_statement_import_save_file.view_bank_statement_form msgid "Imported file" -msgstr "" +msgstr "Archivo importado" + +#. module: account_bank_statement_import_save_file +#: field:account.bank.statement,import_user:0 +msgid "Owner" +msgstr "Propietario" diff --git a/account_bank_statement_import_save_file/i18n/fi.po b/account_bank_statement_import_save_file/i18n/fi.po new file mode 100644 index 0000000..2af0e39 --- /dev/null +++ b/account_bank_statement_import_save_file/i18n/fi.po @@ -0,0 +1,53 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_bank_statement_import_save_file +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: bank-statement-import (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-12-31 01:32+0000\n" +"PO-Revision-Date: 2017-01-11 08:07+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: Finnish (http://www.transifex.com/oca/OCA-bank-statement-import-8-0/language/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_save_file +#: model:ir.model,name:account_bank_statement_import_save_file.model_account_bank_statement +msgid "Bank Statement" +msgstr "" + +#. module: account_bank_statement_import_save_file +#: field:account.bank.statement,import_date:0 +msgid "Date Created" +msgstr "" + +#. module: account_bank_statement_import_save_file +#: field:account.bank.statement,import_log:0 +msgid "Description" +msgstr "Kuvaus" + +#. module: account_bank_statement_import_save_file +#: model:ir.model,name:account_bank_statement_import_save_file.model_account_bank_statement_import +msgid "Import Bank Statement" +msgstr "Tuo pankkiaineisto" + +#. module: account_bank_statement_import_save_file +#: field:account.bank.statement,import_file:0 +msgid "Import file" +msgstr "" + +#. module: account_bank_statement_import_save_file +#: view:account.bank.statement:account_bank_statement_import_save_file.view_bank_statement_form +msgid "Imported file" +msgstr "" + +#. module: account_bank_statement_import_save_file +#: field:account.bank.statement,import_user:0 +msgid "Owner" +msgstr "" diff --git a/account_bank_statement_import_save_file/i18n/fr.po b/account_bank_statement_import_save_file/i18n/fr.po index e72d0f9..599ec40 100644 --- a/account_bank_statement_import_save_file/i18n/fr.po +++ b/account_bank_statement_import_save_file/i18n/fr.po @@ -3,13 +3,14 @@ # * account_bank_statement_import_save_file # # Translators: +# Christophe CHAUVET , 2016 msgid "" msgstr "" "Project-Id-Version: bank-statement-import (8.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-09-01 16:24+0000\n" -"PO-Revision-Date: 2015-09-01 16:25+0000\n" -"Last-Translator: <>\n" +"POT-Creation-Date: 2016-12-24 00:33+0000\n" +"PO-Revision-Date: 2016-12-30 08:19+0000\n" +"Last-Translator: Christophe CHAUVET \n" "Language-Team: French (http://www.transifex.com/oca/OCA-bank-statement-import-8-0/language/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -20,7 +21,17 @@ msgstr "" #. module: account_bank_statement_import_save_file #: model:ir.model,name:account_bank_statement_import_save_file.model_account_bank_statement msgid "Bank Statement" -msgstr "" +msgstr "Relevé bancaire" + +#. module: account_bank_statement_import_save_file +#: field:account.bank.statement,import_date:0 +msgid "Date Created" +msgstr "Date de création" + +#. module: account_bank_statement_import_save_file +#: field:account.bank.statement,import_log:0 +msgid "Description" +msgstr "Description" #. module: account_bank_statement_import_save_file #: model:ir.model,name:account_bank_statement_import_save_file.model_account_bank_statement_import @@ -30,9 +41,14 @@ msgstr "Importer Relevé Bancaire" #. module: account_bank_statement_import_save_file #: field:account.bank.statement,import_file:0 msgid "Import file" -msgstr "" +msgstr "Fichier importé" #. module: account_bank_statement_import_save_file #: view:account.bank.statement:account_bank_statement_import_save_file.view_bank_statement_form msgid "Imported file" -msgstr "" +msgstr "Fichier importé" + +#. module: account_bank_statement_import_save_file +#: field:account.bank.statement,import_user:0 +msgid "Owner" +msgstr "Propriétaire" diff --git a/account_bank_statement_import_save_file/i18n/it.po b/account_bank_statement_import_save_file/i18n/it.po new file mode 100644 index 0000000..d38275c --- /dev/null +++ b/account_bank_statement_import_save_file/i18n/it.po @@ -0,0 +1,53 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_bank_statement_import_save_file +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: bank-statement-import (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-09-21 16:09+0000\n" +"PO-Revision-Date: 2016-10-04 09:43+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: Italian (http://www.transifex.com/oca/OCA-bank-statement-import-8-0/language/it/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: it\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: account_bank_statement_import_save_file +#: model:ir.model,name:account_bank_statement_import_save_file.model_account_bank_statement +msgid "Bank Statement" +msgstr "" + +#. module: account_bank_statement_import_save_file +#: field:account.bank.statement,import_date:0 +msgid "Date Created" +msgstr "" + +#. module: account_bank_statement_import_save_file +#: field:account.bank.statement,import_log:0 +msgid "Description" +msgstr "Descrizione" + +#. module: account_bank_statement_import_save_file +#: model:ir.model,name:account_bank_statement_import_save_file.model_account_bank_statement_import +msgid "Import Bank Statement" +msgstr "" + +#. module: account_bank_statement_import_save_file +#: field:account.bank.statement,import_file:0 +msgid "Import file" +msgstr "" + +#. module: account_bank_statement_import_save_file +#: view:account.bank.statement:account_bank_statement_import_save_file.view_bank_statement_form +msgid "Imported file" +msgstr "" + +#. module: account_bank_statement_import_save_file +#: field:account.bank.statement,import_user:0 +msgid "Owner" +msgstr "Proprietario" diff --git a/account_bank_statement_import_save_file/i18n/lt.po b/account_bank_statement_import_save_file/i18n/lt.po new file mode 100644 index 0000000..3e73dde --- /dev/null +++ b/account_bank_statement_import_save_file/i18n/lt.po @@ -0,0 +1,53 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_bank_statement_import_save_file +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: bank-statement-import (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-10-14 13:36+0000\n" +"PO-Revision-Date: 2016-10-11 09:51+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: Lithuanian (http://www.transifex.com/oca/OCA-bank-statement-import-8-0/language/lt/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: 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_save_file +#: model:ir.model,name:account_bank_statement_import_save_file.model_account_bank_statement +msgid "Bank Statement" +msgstr "" + +#. module: account_bank_statement_import_save_file +#: field:account.bank.statement,import_date:0 +msgid "Date Created" +msgstr "" + +#. module: account_bank_statement_import_save_file +#: field:account.bank.statement,import_log:0 +msgid "Description" +msgstr "Aprašymas" + +#. module: account_bank_statement_import_save_file +#: model:ir.model,name:account_bank_statement_import_save_file.model_account_bank_statement_import +msgid "Import Bank Statement" +msgstr "" + +#. module: account_bank_statement_import_save_file +#: field:account.bank.statement,import_file:0 +msgid "Import file" +msgstr "" + +#. module: account_bank_statement_import_save_file +#: view:account.bank.statement:account_bank_statement_import_save_file.view_bank_statement_form +msgid "Imported file" +msgstr "" + +#. module: account_bank_statement_import_save_file +#: field:account.bank.statement,import_user:0 +msgid "Owner" +msgstr "" diff --git a/account_bank_statement_import_save_file/i18n/pt_BR.po b/account_bank_statement_import_save_file/i18n/pt_BR.po index fb4c685..f9be589 100644 --- a/account_bank_statement_import_save_file/i18n/pt_BR.po +++ b/account_bank_statement_import_save_file/i18n/pt_BR.po @@ -4,13 +4,15 @@ # # Translators: # danimaribeiro , 2015 +# danimaribeiro , 2015 +# Paulo Ricardo , 2016 msgid "" msgstr "" "Project-Id-Version: bank-statement-import (8.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-10-09 09:23+0000\n" -"PO-Revision-Date: 2015-10-09 00:25+0000\n" -"Last-Translator: danimaribeiro \n" +"POT-Creation-Date: 2016-06-11 07:26+0000\n" +"PO-Revision-Date: 2016-06-14 12:13+0000\n" +"Last-Translator: Paulo Ricardo \n" "Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-bank-statement-import-8-0/language/pt_BR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -23,6 +25,16 @@ msgstr "" msgid "Bank Statement" msgstr "Extrato bancário" +#. module: account_bank_statement_import_save_file +#: field:account.bank.statement,import_date:0 +msgid "Date Created" +msgstr "Data de Criação" + +#. module: account_bank_statement_import_save_file +#: field:account.bank.statement,import_log:0 +msgid "Description" +msgstr "Descrição" + #. module: account_bank_statement_import_save_file #: model:ir.model,name:account_bank_statement_import_save_file.model_account_bank_statement_import msgid "Import Bank Statement" @@ -37,3 +49,8 @@ msgstr "Importar arquivo." #: view:account.bank.statement:account_bank_statement_import_save_file.view_bank_statement_form msgid "Imported file" msgstr "Arquivo importado." + +#. module: account_bank_statement_import_save_file +#: field:account.bank.statement,import_user:0 +msgid "Owner" +msgstr "Proprietário" diff --git a/account_bank_statement_import_save_file/i18n/pt_PT.po b/account_bank_statement_import_save_file/i18n/pt_PT.po new file mode 100644 index 0000000..c7bfee5 --- /dev/null +++ b/account_bank_statement_import_save_file/i18n/pt_PT.po @@ -0,0 +1,54 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_bank_statement_import_save_file +# +# Translators: +# Pedro Castro Silva , 2016 +msgid "" +msgstr "" +"Project-Id-Version: bank-statement-import (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-08-18 10:27+0000\n" +"PO-Revision-Date: 2016-09-07 09:16+0000\n" +"Last-Translator: Pedro Castro Silva \n" +"Language-Team: Portuguese (Portugal) (http://www.transifex.com/oca/OCA-bank-statement-import-8-0/language/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_save_file +#: model:ir.model,name:account_bank_statement_import_save_file.model_account_bank_statement +msgid "Bank Statement" +msgstr "Extrato Bancário" + +#. module: account_bank_statement_import_save_file +#: field:account.bank.statement,import_date:0 +msgid "Date Created" +msgstr "Data de Criação" + +#. module: account_bank_statement_import_save_file +#: field:account.bank.statement,import_log:0 +msgid "Description" +msgstr "Descrição" + +#. module: account_bank_statement_import_save_file +#: model:ir.model,name:account_bank_statement_import_save_file.model_account_bank_statement_import +msgid "Import Bank Statement" +msgstr "Importar Extrato Bancário" + +#. module: account_bank_statement_import_save_file +#: field:account.bank.statement,import_file:0 +msgid "Import file" +msgstr "Importar ficheiro" + +#. module: account_bank_statement_import_save_file +#: view:account.bank.statement:account_bank_statement_import_save_file.view_bank_statement_form +msgid "Imported file" +msgstr "Ficheiro importado" + +#. module: account_bank_statement_import_save_file +#: field:account.bank.statement,import_user:0 +msgid "Owner" +msgstr "Dono" diff --git a/account_bank_statement_import_save_file/i18n/sl.po b/account_bank_statement_import_save_file/i18n/sl.po index 22153b4..3642a19 100644 --- a/account_bank_statement_import_save_file/i18n/sl.po +++ b/account_bank_statement_import_save_file/i18n/sl.po @@ -3,13 +3,13 @@ # * account_bank_statement_import_save_file # # Translators: -# Matjaž Mozetič , 2015 +# Matjaž Mozetič , 2015-2016 msgid "" msgstr "" "Project-Id-Version: bank-statement-import (8.0)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-09-01 16:24+0000\n" -"PO-Revision-Date: 2015-09-07 14:22+0000\n" +"POT-Creation-Date: 2016-06-11 07:26+0000\n" +"PO-Revision-Date: 2016-06-12 22:42+0000\n" "Last-Translator: Matjaž Mozetič \n" "Language-Team: Slovenian (http://www.transifex.com/oca/OCA-bank-statement-import-8-0/language/sl/)\n" "MIME-Version: 1.0\n" @@ -23,6 +23,16 @@ msgstr "" msgid "Bank Statement" msgstr "Bančni izpisek" +#. module: account_bank_statement_import_save_file +#: field:account.bank.statement,import_date:0 +msgid "Date Created" +msgstr "Datum nastanka" + +#. module: account_bank_statement_import_save_file +#: field:account.bank.statement,import_log:0 +msgid "Description" +msgstr "Opis" + #. module: account_bank_statement_import_save_file #: model:ir.model,name:account_bank_statement_import_save_file.model_account_bank_statement_import msgid "Import Bank Statement" @@ -37,3 +47,8 @@ msgstr "Uvoz datoteke" #: view:account.bank.statement:account_bank_statement_import_save_file.view_bank_statement_form msgid "Imported file" msgstr "Uvožena datoteka" + +#. module: account_bank_statement_import_save_file +#: field:account.bank.statement,import_user:0 +msgid "Owner" +msgstr "Lastnik" diff --git a/account_bank_statement_import_save_file/models/__init__.py b/account_bank_statement_import_save_file/models/__init__.py index 84bff13..9413d5c 100644 --- a/account_bank_statement_import_save_file/models/__init__.py +++ b/account_bank_statement_import_save_file/models/__init__.py @@ -1,22 +1,6 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# This module copyright (C) 2015 Therp BV . -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# © 2015 Therp BV (). +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + from . import account_bank_statement from . import account_bank_statement_import diff --git a/account_bank_statement_import_save_file/models/account_bank_statement.py b/account_bank_statement_import_save_file/models/account_bank_statement.py index 9b7073b..a221c13 100644 --- a/account_bank_statement_import_save_file/models/account_bank_statement.py +++ b/account_bank_statement_import_save_file/models/account_bank_statement.py @@ -1,24 +1,8 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# This module copyright (C) 2015 Therp BV (). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## -from openerp import models, fields +# © 2015 Therp BV (). +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import models, fields class AccountBankStatement(models.Model): diff --git a/account_bank_statement_import_save_file/models/account_bank_statement_import.py b/account_bank_statement_import_save_file/models/account_bank_statement_import.py index 875e2c7..7263dc4 100644 --- a/account_bank_statement_import_save_file/models/account_bank_statement_import.py +++ b/account_bank_statement_import_save_file/models/account_bank_statement_import.py @@ -1,41 +1,28 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# This module copyright (C) 2015 Therp BV (). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# © 2015 Therp BV (). +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + import base64 -from openerp import models, api +from odoo import models, api class AccountBankStatementImport(models.TransientModel): _inherit = 'account.bank.statement.import' @api.model - def _import_file(self, data_file): - (statement_ids, notifications) = \ - super(AccountBankStatementImport, self)._import_file(data_file) + def import_file(self): + action = \ + super(AccountBankStatementImport, self).import_file() + statement_ids = action.get('context', {}).get('statement_ids') + notifications = action.get('context', {}).get('notifications') + data_file = base64.b64decode(self.data_file) if statement_ids: self.env['account.bank.statement'].browse(statement_ids).write({ 'import_file': self.env['ir.attachment'].create( self._create_import_file_attachment_data( data_file, statement_ids[0], notifications)).id, }) - return (statement_ids, notifications) + return action @api.model def _create_import_file_attachment_data(self, data_file, statement_id, @@ -46,5 +33,7 @@ class AccountBankStatementImport(models.TransientModel): 'res_id': statement_id, 'type': 'binary', 'datas': base64.b64encode(data_file), - 'description': notifications, + 'description': '\n'.join( + '%(type)s: %(message)s' % notification + for notification in notifications) or False, } diff --git a/account_bank_statement_import_save_file/tests/__init__.py b/account_bank_statement_import_save_file/tests/__init__.py index f06dd21..6086380 100644 --- a/account_bank_statement_import_save_file/tests/__init__.py +++ b/account_bank_statement_import_save_file/tests/__init__.py @@ -1,21 +1,5 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# This module copyright (C) 2015 Therp BV . -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# © 2015 Therp BV (). +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + from . import test_save_file diff --git a/account_bank_statement_import_save_file/tests/test_save_file.py b/account_bank_statement_import_save_file/tests/test_save_file.py index 7e5b186..3a65886 100644 --- a/account_bank_statement_import_save_file/tests/test_save_file.py +++ b/account_bank_statement_import_save_file/tests/test_save_file.py @@ -1,26 +1,11 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# This module copyright (C) 2015 Therp BV . -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# © 2015 Therp BV (). +# © 2017 Today Mourad EL HADJ MIMOUNE +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + import base64 -from openerp import api, models -from openerp.tests.common import TransactionCase +from odoo import api, models +from odoo.tests.common import TransactionCase acc_number = 'BE1234567890' @@ -48,31 +33,26 @@ class HelloWorldParser(models.TransientModel): class TestSaveFile(TransactionCase): + def setUp(self): + super(TestSaveFile, self).setUp() + self.currency_eur_id = self.env.ref("base.EUR").id + self.bank_journal_euro = self.env['account.journal'].create( + {'name': 'Bank', + 'type': 'bank', + 'code': 'BNK_test_imp', + 'currency_id': self.currency_eur_id + }) + def test_SaveFile(self): HelloWorldParser._build_model(self.registry, self.cr) import_wizard = self.env['account.bank.statement.import'] - import_wizard._prepare_setup() - import_wizard._setup_base(False) - import_wizard._setup_fields() - import_wizard._setup_complete() - import_wizard._auto_init() - journal_id = self.env['res.partner.bank'].search([ - ('acc_number', '=', acc_number), - ]).journal_id.id - if not journal_id: - account = import_wizard._create_bank_account(acc_number) - journal_id = self.env['account.journal']\ - .search([ - '|', - ('currency.name', '=', 'EUR'), - ('currency', '=', False) - ]).ids[0] - account.journal_id = journal_id - action = import_wizard.with_context(journal_id=journal_id)\ - .create({'data_file': base64.b64encode('hello world')})\ - .import_file() + journal_id = self.bank_journal_euro.id + import_wizard_id = import_wizard.with_context(journal_id=journal_id)\ + .create( + {'data_file': base64.b64encode(bytes('Hello world'))}) + action = import_wizard_id.import_file() for statement in self.env['account.bank.statement'].browse( action['context']['statement_ids']): self.assertEqual( base64.b64decode(statement.import_file.datas), - 'hello world') + 'Hello world') diff --git a/account_bank_statement_import_save_file/views/account_bank_statement.xml b/account_bank_statement_import_save_file/views/account_bank_statement.xml index ab0ce41..c1375ac 100644 --- a/account_bank_statement_import_save_file/views/account_bank_statement.xml +++ b/account_bank_statement_import_save_file/views/account_bank_statement.xml @@ -1,25 +1,23 @@ - - - - account.bank.statement - - - - + + + account.bank.statement + + + + + - - - - - - - + - - - - - - - + + + + + + + + + + +