From 952aa321b0b4db0108e6383181102d01d397cfba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Mon, 5 Dec 2022 12:14:37 +0100 Subject: [PATCH] [FIX] account_bank_statement_import_online_qonto: Avoid errors if year is different TT40742 --- .../README.rst | 15 ++++--- .../__manifest__.py | 2 +- .../online_bank_statement_provider_qonto.py | 9 +++- .../static/description/index.html | 42 ++++++++++--------- 4 files changed, 39 insertions(+), 29 deletions(-) diff --git a/account_statement_import_online_qonto/README.rst b/account_statement_import_online_qonto/README.rst index 4d49d135..4175d853 100644 --- a/account_statement_import_online_qonto/README.rst +++ b/account_statement_import_online_qonto/README.rst @@ -2,10 +2,13 @@ Online Bank Statements: Qonto ============================= -.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:4ee67601b7ef05d8901653197e548977046329fd4bfadb5e12d3077a89bcc3fd + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png :target: https://odoo-community.org/page/development-status @@ -19,11 +22,11 @@ Online Bank Statements: Qonto .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png :target: https://translation.odoo-community.org/projects/bank-statement-import-13-0/bank-statement-import-13-0-account_bank_statement_import_online_qonto :alt: Translate me on Weblate -.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/174/13.0 - :alt: Try me on Runbot +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/bank-statement-import&target_branch=13.0 + :alt: Try me on Runboat -|badge1| |badge2| |badge3| |badge4| |badge5| +|badge1| |badge2| |badge3| |badge4| |badge5| This module provides online bank statements from Qonto Bank. @@ -77,7 +80,7 @@ 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 smashing it by providing a detailed and welcomed +If you spotted it first, help us to smash it by providing a detailed and welcomed `feedback `_. Do not contact contributors directly about support or help with technical issues. diff --git a/account_statement_import_online_qonto/__manifest__.py b/account_statement_import_online_qonto/__manifest__.py index 0dacf02e..6f474194 100644 --- a/account_statement_import_online_qonto/__manifest__.py +++ b/account_statement_import_online_qonto/__manifest__.py @@ -1,7 +1,7 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). { "name": "Online Bank Statements: Qonto", - "version": "13.0.1.0.0", + "version": "13.0.1.0.1", "category": "Account", "website": "https://github.com/OCA/bank-statement-import", "author": "Florent de Labarre, Odoo Community Association (OCA)", diff --git a/account_statement_import_online_qonto/models/online_bank_statement_provider_qonto.py b/account_statement_import_online_qonto/models/online_bank_statement_provider_qonto.py index 9cad1f42..2cc04231 100644 --- a/account_statement_import_online_qonto/models/online_bank_statement_provider_qonto.py +++ b/account_statement_import_online_qonto/models/online_bank_statement_provider_qonto.py @@ -6,7 +6,7 @@ from datetime import datetime import pytz import requests -from odoo import _, api, models +from odoo import _, api, fields, models from odoo.exceptions import UserError from odoo.addons.base.models.res_bank import sanitize_account_number @@ -62,7 +62,12 @@ class OnlineBankStatementProviderQonto(models.Model): self.ensure_one() url = QONTO_ENDPOINT + "/transactions" params = {"slug": slug, "iban": self.account_number} - + # settled_at_to param isn't well formatted (ISO 8601) or year is out of range". + # We set the last day of the year in such case. + if date_since and date_until and date_since.year != date_until.year: + date_until = fields.Datetime.from_string( + "%s-12-31 23:59:59" % date_since.year + ) if date_since: params["settled_at_from"] = ( date_since.replace(microsecond=0).isoformat() + "Z" diff --git a/account_statement_import_online_qonto/static/description/index.html b/account_statement_import_online_qonto/static/description/index.html index 7312fd0c..e700f0c2 100644 --- a/account_statement_import_online_qonto/static/description/index.html +++ b/account_statement_import_online_qonto/static/description/index.html @@ -1,20 +1,20 @@ - + - + Online Bank Statements: Qonto