|
@ -5,7 +5,7 @@ import json |
|
|
from datetime import datetime |
|
|
from datetime import datetime |
|
|
import pytz |
|
|
import pytz |
|
|
|
|
|
|
|
|
from odoo import api, models, _ |
|
|
|
|
|
|
|
|
from odoo import _, api, fields, models |
|
|
from odoo.exceptions import UserError |
|
|
from odoo.exceptions import UserError |
|
|
from odoo.addons.base.models.res_bank import sanitize_account_number |
|
|
from odoo.addons.base.models.res_bank import sanitize_account_number |
|
|
|
|
|
|
|
@ -66,7 +66,12 @@ class OnlineBankStatementProviderQonto(models.Model): |
|
|
self.ensure_one() |
|
|
self.ensure_one() |
|
|
url = QONTO_ENDPOINT + "/transactions" |
|
|
url = QONTO_ENDPOINT + "/transactions" |
|
|
params = {"slug": slug, "iban": self.account_number} |
|
|
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: |
|
|
if date_since: |
|
|
params["settled_at_from"] = ( |
|
|
params["settled_at_from"] = ( |
|
|
date_since.replace(microsecond=0).isoformat() + "Z" |
|
|
date_since.replace(microsecond=0).isoformat() + "Z" |
|
|