diff --git a/account_statement_import_online_gocardless/README.rst b/account_statement_import_online_gocardless/README.rst index ffe44c6d..e25bf2fb 100644 --- a/account_statement_import_online_gocardless/README.rst +++ b/account_statement_import_online_gocardless/README.rst @@ -7,7 +7,7 @@ Online Bank Statements: GoCardless !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:4d87690ed02f68a1c4cad9976f65c1109112c608a3d63dd93fdcca49e0319f2b + !! source digest: sha256:ee02b1d6ddcdef85f00fec3cfe359e76f897722fa2055e83769a41515b6455cb !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/account_statement_import_online_gocardless/__init__.py b/account_statement_import_online_gocardless/__init__.py index f4a659ef..2c33cb2a 100644 --- a/account_statement_import_online_gocardless/__init__.py +++ b/account_statement_import_online_gocardless/__init__.py @@ -1,4 +1,5 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -from . import models from . import controllers +from . import models +from . import wizards diff --git a/account_statement_import_online_gocardless/__manifest__.py b/account_statement_import_online_gocardless/__manifest__.py index bc551958..26db9541 100644 --- a/account_statement_import_online_gocardless/__manifest__.py +++ b/account_statement_import_online_gocardless/__manifest__.py @@ -1,5 +1,5 @@ # Copyright 2022 ForgeFlow S.L. -# Copyright 2023 Tecnativa - Pedro M. Baeza +# Copyright 2023-2024 Tecnativa - Pedro M. Baeza # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). { "name": "Online Bank Statements: GoCardless", @@ -12,7 +12,11 @@ "depends": [ "account_statement_import_online", ], - "data": ["view/online_bank_statement_provider.xml"], + "data": [ + "security/ir.model.access.csv", + "view/online_bank_statement_provider.xml", + "wizards/online_bank_statement_provider_existing_views.xml", + ], "assets": { "web.assets_backend": [ "account_statement_import_online_gocardless/static/src/" diff --git a/account_statement_import_online_gocardless/i18n/account_statement_import_online_gocardless.pot b/account_statement_import_online_gocardless/i18n/account_statement_import_online_gocardless.pot index efb88956..9e82b179 100644 --- a/account_statement_import_online_gocardless/i18n/account_statement_import_online_gocardless.pot +++ b/account_statement_import_online_gocardless/i18n/account_statement_import_online_gocardless.pot @@ -6,6 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-04-22 18:19+0000\n" +"PO-Revision-Date: 2024-04-22 18:19+0000\n" "Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -13,6 +15,14 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" +#. module: account_statement_import_online_gocardless +#: model_terms:ir.ui.view,arch_db:account_statement_import_online_gocardless.view_online_bank_statement_provider_existing_form +msgid "" +" There's already another journal from the " +"same bank institution linked with GoCardless. Do you want to reuse the " +"existing credentials or create new ones?" +msgstr "" + #. module: account_statement_import_online_gocardless #. odoo-javascript #: code:addons/account_statement_import_online_gocardless/static/src/xml/select_bank_widget.xml:0 @@ -20,6 +30,28 @@ msgstr "" msgid "Available countries:" msgstr "" +#. module: account_statement_import_online_gocardless +#: model:ir.model.fields,field_description:account_statement_import_online_gocardless.field_online_bank_statement_provider_existing__create_uid +msgid "Created by" +msgstr "" + +#. module: account_statement_import_online_gocardless +#: model:ir.model.fields,field_description:account_statement_import_online_gocardless.field_online_bank_statement_provider_existing__create_date +msgid "Created on" +msgstr "" + +#. module: account_statement_import_online_gocardless +#: model:ir.model.fields,field_description:account_statement_import_online_gocardless.field_online_bank_statement_provider_existing__display_name +msgid "Display Name" +msgstr "" + +#. module: account_statement_import_online_gocardless +#. odoo-python +#: code:addons/account_statement_import_online_gocardless/models/online_bank_statement_provider.py:0 +#, python-format +msgid "Existing link" +msgstr "" + #. module: account_statement_import_online_gocardless #: model_terms:ir.ui.view,arch_db:account_statement_import_online_gocardless.online_bank_statement_provider_form msgid "GoCardless" @@ -70,6 +102,11 @@ msgstr "" msgid "Gocardless Token Expiration" msgstr "" +#. module: account_statement_import_online_gocardless +#: model:ir.model.fields,field_description:account_statement_import_online_gocardless.field_online_bank_statement_provider_existing__id +msgid "ID" +msgstr "" + #. module: account_statement_import_online_gocardless #. odoo-python #: code:addons/account_statement_import_online_gocardless/models/online_bank_statement_provider.py:0 @@ -77,11 +114,46 @@ msgstr "" msgid "Incorrect country code or country not supported." msgstr "" +#. module: account_statement_import_online_gocardless +#: model:ir.model.fields,field_description:account_statement_import_online_gocardless.field_online_bank_statement_provider_existing____last_update +msgid "Last Modified on" +msgstr "" + +#. module: account_statement_import_online_gocardless +#: model:ir.model.fields,field_description:account_statement_import_online_gocardless.field_online_bank_statement_provider_existing__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: account_statement_import_online_gocardless +#: model:ir.model.fields,field_description:account_statement_import_online_gocardless.field_online_bank_statement_provider_existing__write_date +msgid "Last Updated on" +msgstr "" + +#. module: account_statement_import_online_gocardless +#: model_terms:ir.ui.view,arch_db:account_statement_import_online_gocardless.view_online_bank_statement_provider_existing_form +msgid "New link" +msgstr "" + #. module: account_statement_import_online_gocardless #: model:ir.model,name:account_statement_import_online_gocardless.model_online_bank_statement_provider msgid "Online Bank Statement Provider" msgstr "" +#. module: account_statement_import_online_gocardless +#: model:ir.model.fields,field_description:account_statement_import_online_gocardless.field_online_bank_statement_provider_existing__other_provider_id +msgid "Other Provider" +msgstr "" + +#. module: account_statement_import_online_gocardless +#: model:ir.model.fields,field_description:account_statement_import_online_gocardless.field_online_bank_statement_provider_existing__provider_id +msgid "Provider" +msgstr "" + +#. module: account_statement_import_online_gocardless +#: model_terms:ir.ui.view,arch_db:account_statement_import_online_gocardless.view_online_bank_statement_provider_existing_form +msgid "Reuse existing" +msgstr "" + #. module: account_statement_import_online_gocardless #. odoo-javascript #: code:addons/account_statement_import_online_gocardless/static/src/xml/select_bank_widget.xml:0 @@ -118,6 +190,13 @@ msgstr "" msgid "Select Country to Filter" msgstr "" +#. module: account_statement_import_online_gocardless +#: model_terms:ir.ui.view,arch_db:account_statement_import_online_gocardless.view_online_bank_statement_provider_existing_form +msgid "" +"Some banks only allow one credentials, while others work better with " +"separate ones, so it's a matter of trying." +msgstr "" + #. module: account_statement_import_online_gocardless #. odoo-python #: code:addons/account_statement_import_online_gocardless/models/online_bank_statement_provider.py:0 @@ -125,6 +204,11 @@ msgstr "" msgid "To continue configure bank account on journal %s" msgstr "" +#. module: account_statement_import_online_gocardless +#: model:ir.model,name:account_statement_import_online_gocardless.model_online_bank_statement_provider_existing +msgid "Wizard for reusing existing GoCardless provider" +msgstr "" + #. module: account_statement_import_online_gocardless #. odoo-python #: code:addons/account_statement_import_online_gocardless/models/online_bank_statement_provider.py:0 diff --git a/account_statement_import_online_gocardless/i18n/es.po b/account_statement_import_online_gocardless/i18n/es.po index e78d1cb1..5379d5b8 100644 --- a/account_statement_import_online_gocardless/i18n/es.po +++ b/account_statement_import_online_gocardless/i18n/es.po @@ -6,15 +6,26 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2024-03-20 20:34+0000\n" +"POT-Creation-Date: 2024-04-22 18:19+0000\n" +"PO-Revision-Date: \n" "Last-Translator: MayteGLC \n" "Language-Team: none\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" -"X-Generator: Weblate 4.17\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 3.0.1\n" + +#. module: account_statement_import_online_gocardless +#: model_terms:ir.ui.view,arch_db:account_statement_import_online_gocardless.view_online_bank_statement_provider_existing_form +msgid "" +" There's already another journal from the " +"same bank institution linked with GoCardless. Do you want to reuse the " +"existing credentials or create new ones?" +msgstr "" +" Ya existe otro diario de la misma " +"institución bancaria enlazado con GoCardless. ¿Quiere reutilizar las " +"credenciales existentes o crear unas nuevas?" #. module: account_statement_import_online_gocardless #. odoo-javascript @@ -23,6 +34,28 @@ msgstr "" msgid "Available countries:" msgstr "Países disponibles:" +#. module: account_statement_import_online_gocardless +#: model:ir.model.fields,field_description:account_statement_import_online_gocardless.field_online_bank_statement_provider_existing__create_uid +msgid "Created by" +msgstr "Creado por" + +#. module: account_statement_import_online_gocardless +#: model:ir.model.fields,field_description:account_statement_import_online_gocardless.field_online_bank_statement_provider_existing__create_date +msgid "Created on" +msgstr "Creado el" + +#. module: account_statement_import_online_gocardless +#: model:ir.model.fields,field_description:account_statement_import_online_gocardless.field_online_bank_statement_provider_existing__display_name +msgid "Display Name" +msgstr "Nombre mostrado" + +#. module: account_statement_import_online_gocardless +#. odoo-python +#: code:addons/account_statement_import_online_gocardless/models/online_bank_statement_provider.py:0 +#, python-format +msgid "Existing link" +msgstr "Enlace existente" + #. module: account_statement_import_online_gocardless #: model_terms:ir.ui.view,arch_db:account_statement_import_online_gocardless.online_bank_statement_provider_form msgid "GoCardless" @@ -73,6 +106,11 @@ msgstr "Token" msgid "Gocardless Token Expiration" msgstr "Caducdad del token" +#. module: account_statement_import_online_gocardless +#: model:ir.model.fields,field_description:account_statement_import_online_gocardless.field_online_bank_statement_provider_existing__id +msgid "ID" +msgstr "Identificador" + #. module: account_statement_import_online_gocardless #. odoo-python #: code:addons/account_statement_import_online_gocardless/models/online_bank_statement_provider.py:0 @@ -80,11 +118,46 @@ msgstr "Caducdad del token" msgid "Incorrect country code or country not supported." msgstr "Código de país incorrecto o país no admitido." +#. module: account_statement_import_online_gocardless +#: model:ir.model.fields,field_description:account_statement_import_online_gocardless.field_online_bank_statement_provider_existing____last_update +msgid "Last Modified on" +msgstr "Última modificación el" + +#. module: account_statement_import_online_gocardless +#: model:ir.model.fields,field_description:account_statement_import_online_gocardless.field_online_bank_statement_provider_existing__write_uid +msgid "Last Updated by" +msgstr "Última modificación por" + +#. module: account_statement_import_online_gocardless +#: model:ir.model.fields,field_description:account_statement_import_online_gocardless.field_online_bank_statement_provider_existing__write_date +msgid "Last Updated on" +msgstr "Última modificación el" + +#. module: account_statement_import_online_gocardless +#: model_terms:ir.ui.view,arch_db:account_statement_import_online_gocardless.view_online_bank_statement_provider_existing_form +msgid "New link" +msgstr "Nuevo enlace" + #. module: account_statement_import_online_gocardless #: model:ir.model,name:account_statement_import_online_gocardless.model_online_bank_statement_provider msgid "Online Bank Statement Provider" msgstr "Proveedor de Extractos Bancarios en Línea" +#. module: account_statement_import_online_gocardless +#: model:ir.model.fields,field_description:account_statement_import_online_gocardless.field_online_bank_statement_provider_existing__other_provider_id +msgid "Other Provider" +msgstr "Otro proveedor" + +#. module: account_statement_import_online_gocardless +#: model:ir.model.fields,field_description:account_statement_import_online_gocardless.field_online_bank_statement_provider_existing__provider_id +msgid "Provider" +msgstr "Proveedor" + +#. module: account_statement_import_online_gocardless +#: model_terms:ir.ui.view,arch_db:account_statement_import_online_gocardless.view_online_bank_statement_provider_existing_form +msgid "Reuse existing" +msgstr "Reutilizar existente" + #. module: account_statement_import_online_gocardless #. odoo-javascript #: code:addons/account_statement_import_online_gocardless/static/src/xml/select_bank_widget.xml:0 @@ -121,6 +194,16 @@ msgstr "Seleccione el Banco de su Cuenta" msgid "Select Country to Filter" msgstr "Seleccione el País a Filtrar" +#. module: account_statement_import_online_gocardless +#: model_terms:ir.ui.view,arch_db:account_statement_import_online_gocardless.view_online_bank_statement_provider_existing_form +msgid "" +"Some banks only allow one credentials, while others work better with " +"separate ones, so it's a matter of trying." +msgstr "" +"Algunos bancos solo permiten unas credenciales, mientras otros funcionan " +"mejor con credenciales separadas, así que es una cuestión de probar ambas " +"opciones." + #. module: account_statement_import_online_gocardless #. odoo-python #: code:addons/account_statement_import_online_gocardless/models/online_bank_statement_provider.py:0 @@ -128,6 +211,11 @@ msgstr "Seleccione el País a Filtrar" msgid "To continue configure bank account on journal %s" msgstr "Para seguir configurando la cuenta bancaria en el diario %s" +#. module: account_statement_import_online_gocardless +#: model:ir.model,name:account_statement_import_online_gocardless.model_online_bank_statement_provider_existing +msgid "Wizard for reusing existing GoCardless provider" +msgstr "Asistente para reutilizar un proveedor de GoCardless existente" + #. module: account_statement_import_online_gocardless #. odoo-python #: code:addons/account_statement_import_online_gocardless/models/online_bank_statement_provider.py:0 diff --git a/account_statement_import_online_gocardless/models/online_bank_statement_provider.py b/account_statement_import_online_gocardless/models/online_bank_statement_provider.py index 66cbd265..dfdb9724 100644 --- a/account_statement_import_online_gocardless/models/online_bank_statement_provider.py +++ b/account_statement_import_online_gocardless/models/online_bank_statement_provider.py @@ -1,5 +1,5 @@ # Copyright 2022 ForgeFlow S.L. -# Copyright 2023 Tecnativa - Pedro M. Baeza +# Copyright 2023-2024 Tecnativa - Pedro M. Baeza # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). import json from datetime import datetime @@ -104,8 +104,8 @@ class OnlineBankStatementProvider(models.Model): % (self.journal_id.display_name) ) # Check if there's another existing provider for the same bank institution, - # and reuse it for this bank account, as some banks don't allow several - # requisitions from the same source (GoCardless). + # and ask for reusing it for this bank account, as some banks don't allow + # several requisitions from the same source (GoCardless). other = self.search( [ ("service", "=", "gocardless"), @@ -116,19 +116,24 @@ class OnlineBankStatementProvider(models.Model): limit=1, ) if other: - self.write( + wizard = self.env["online.bank.statement.provider.existing"].create( { - "gocardless_requisition_ref": other.gocardless_requisition_ref, - "gocardless_requisition_id": other.gocardless_requisition_id, - "gocardless_requisition_expiration": ( - other.gocardless_requisition_expiration - ), - "gocardless_institution_id": other.gocardless_institution_id, + "provider_id": self.id, + "other_provider_id": other.id, } ) - if self._gocardless_finish_requisition(dry=True): - return - # Ask for the institution and continue normal process otherwise + return { + "type": "ir.actions.act_window", + "res_model": wizard._name, + "res_id": wizard.id, + "name": _("Existing link"), + "view_mode": "form", + "target": "new", + } + return self._gocardless_select_bank_instituion() + + def _gocardless_select_bank_instituion(self): + """Ask for the GoCardless bank instituion and continue full linkage.""" country = ( self.journal_id.bank_account_id.company_id or self.journal_id.company_id ).country_id diff --git a/account_statement_import_online_gocardless/security/ir.model.access.csv b/account_statement_import_online_gocardless/security/ir.model.access.csv new file mode 100644 index 00000000..794573f3 --- /dev/null +++ b/account_statement_import_online_gocardless/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_online_bank_statement_provider_existing,access_online_bank_statement_provider_existing,model_online_bank_statement_provider_existing,account.group_account_user,1,1,1,0 diff --git a/account_statement_import_online_gocardless/static/description/index.html b/account_statement_import_online_gocardless/static/description/index.html index 11f18aee..bd556eb4 100644 --- a/account_statement_import_online_gocardless/static/description/index.html +++ b/account_statement_import_online_gocardless/static/description/index.html @@ -1,3 +1,4 @@ + @@ -366,7 +367,7 @@ ul.auto-toc { !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:4d87690ed02f68a1c4cad9976f65c1109112c608a3d63dd93fdcca49e0319f2b +!! source digest: sha256:ee02b1d6ddcdef85f00fec3cfe359e76f897722fa2055e83769a41515b6455cb !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Beta License: AGPL-3 OCA/bank-statement-import Translate me on Weblate Try me on Runboat

This module provides online bank statements from GoCardless Bank Account Data, diff --git a/account_statement_import_online_gocardless/view/online_bank_statement_provider.xml b/account_statement_import_online_gocardless/view/online_bank_statement_provider.xml index 2fe66c79..2c8ca375 100644 --- a/account_statement_import_online_gocardless/view/online_bank_statement_provider.xml +++ b/account_statement_import_online_gocardless/view/online_bank_statement_provider.xml @@ -39,6 +39,7 @@