diff --git a/account_statement_import_online/README.rst b/account_statement_import_online/README.rst index aa2b19ac..9788e9c6 100644 --- a/account_statement_import_online/README.rst +++ b/account_statement_import_online/README.rst @@ -7,7 +7,7 @@ Online Bank Statements !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:5f8fb744f2638751d3401c3c729502aa387c024bbf66769c89302067a5c7bf28 + !! source digest: sha256:8fcd953e1f7dbcc59cc99c790825bef09e423b32ca67b7ac5714e12b1ced7b5c !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/account_statement_import_online/__manifest__.py b/account_statement_import_online/__manifest__.py index 4f2c612c..a982f8c8 100644 --- a/account_statement_import_online/__manifest__.py +++ b/account_statement_import_online/__manifest__.py @@ -19,6 +19,7 @@ "data/account_statement_import_online.xml", "security/ir.model.access.csv", "security/online_bank_statement_provider.xml", + "wizards/online_bank_statement_pull_debug.xml", "wizards/online_bank_statement_pull_wizard.xml", "views/actions.xml", "views/account_journal.xml", diff --git a/account_statement_import_online/models/online_bank_statement_provider.py b/account_statement_import_online/models/online_bank_statement_provider.py index a6e83d3c..cb9081a3 100644 --- a/account_statement_import_online/models/online_bank_statement_provider.py +++ b/account_statement_import_online/models/online_bank_statement_provider.py @@ -1,6 +1,7 @@ # Copyright 2019-2020 Brainbean Apps (https://brainbeanapps.com) # Copyright 2019-2020 Dataplug (https://dataplug.io) # Copyright 2022-2023 Therp BV (https://therp.nl) +# Copyright 2014 Tecnativa - Pedro M. Baeza # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). import logging @@ -185,6 +186,8 @@ class OnlineBankStatementProvider(models.Model): def _pull(self, date_since, date_until): """Pull data for all providers within requested period.""" is_scheduled = self.env.context.get("scheduled") + debug = self.env.context.get("account_statement_online_import_debug") + debug_data = [] for provider in self: statement_date_since = provider._get_statement_date_since(date_since) while statement_date_since < date_until: @@ -205,12 +208,16 @@ class OnlineBankStatementProvider(models.Model): exception, statement_date_since, statement_date_until ) break # Continue with next provider. - provider._create_or_update_statement( - data, statement_date_since, statement_date_until - ) + if debug: + debug_data += data + else: + provider._create_or_update_statement( + data, statement_date_since, statement_date_until + ) statement_date_since = statement_date_until if is_scheduled: provider._schedule_next_run() + return debug_data def _log_provider_exception( self, exception, statement_date_since, statement_date_until diff --git a/account_statement_import_online/security/ir.model.access.csv b/account_statement_import_online/security/ir.model.access.csv index d0856372..22a9f544 100644 --- a/account_statement_import_online/security/ir.model.access.csv +++ b/account_statement_import_online/security/ir.model.access.csv @@ -1,4 +1,5 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink access_online_bank_statement_provider_admin,online.bank.statement.provider:base.group_system,model_online_bank_statement_provider,base.group_system,1,1,1,1 access_online_bank_statement_provider_user,online.bank.statement.provider:account.group_account_user,model_online_bank_statement_provider,account.group_account_user,1,1,1,1 +access_online_bank_statement_pull_debug_user,online.bank.statement.pull.debug:account.group_account_user,model_online_bank_statement_pull_debug,account.group_account_user,1,1,1,1 access_online_bank_statement_pull_wizard_user,online.bank.statement.pull.wizard:account.group_account_user,model_online_bank_statement_pull_wizard,account.group_account_user,1,1,1,1 diff --git a/account_statement_import_online/static/description/index.html b/account_statement_import_online/static/description/index.html index 7f0fc667..a390ff5e 100644 --- a/account_statement_import_online/static/description/index.html +++ b/account_statement_import_online/static/description/index.html @@ -367,7 +367,7 @@ ul.auto-toc { !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:5f8fb744f2638751d3401c3c729502aa387c024bbf66769c89302067a5c7bf28 +!! source digest: sha256:8fcd953e1f7dbcc59cc99c790825bef09e423b32ca67b7ac5714e12b1ced7b5c !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
This module provides base for building online bank statements providers.
diff --git a/account_statement_import_online/wizards/__init__.py b/account_statement_import_online/wizards/__init__.py index a8ac6626..f7fd2d8d 100644 --- a/account_statement_import_online/wizards/__init__.py +++ b/account_statement_import_online/wizards/__init__.py @@ -1,3 +1,4 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from . import online_bank_statement_pull_debug from . import online_bank_statement_pull_wizard diff --git a/account_statement_import_online/wizards/online_bank_statement_pull_debug.py b/account_statement_import_online/wizards/online_bank_statement_pull_debug.py new file mode 100644 index 00000000..90d834a4 --- /dev/null +++ b/account_statement_import_online/wizards/online_bank_statement_pull_debug.py @@ -0,0 +1,11 @@ +# Copyright 2024 Tecnativa - Pedro M. Baeza +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class OnlineBankStatementPullWizard(models.TransientModel): + _name = "online.bank.statement.pull.debug" + _description = "Online Bank Statement Pull Debug Wizard" + + data = fields.Text(string="RAW data", required=True, readonly=True) diff --git a/account_statement_import_online/wizards/online_bank_statement_pull_debug.xml b/account_statement_import_online/wizards/online_bank_statement_pull_debug.xml new file mode 100644 index 00000000..29fc0468 --- /dev/null +++ b/account_statement_import_online/wizards/online_bank_statement_pull_debug.xml @@ -0,0 +1,24 @@ + + +