From c63a31d5ab302e4b9895c26d9334ec37f2837a14 Mon Sep 17 00:00:00 2001 From: Alexey Pelykh Date: Thu, 22 Oct 2020 14:34:17 +0300 Subject: [PATCH] [FIX] account_bank_statement_import_online_transferwise: charset --- .../__manifest__.py | 2 +- ...k_statement_import_online_transferwise.pot | 8 +-- .../i18n/nl.po | 61 +++++++++++++++++++ ...ne_bank_statement_provider_transferwise.py | 7 ++- 4 files changed, 72 insertions(+), 6 deletions(-) create mode 100644 account_bank_statement_import_online_transferwise/i18n/nl.po diff --git a/account_bank_statement_import_online_transferwise/__manifest__.py b/account_bank_statement_import_online_transferwise/__manifest__.py index a6c1185a..bea35228 100644 --- a/account_bank_statement_import_online_transferwise/__manifest__.py +++ b/account_bank_statement_import_online_transferwise/__manifest__.py @@ -4,7 +4,7 @@ { 'name': 'Online Bank Statements: TransferWise.com', - 'version': '12.0.1.0.2', + 'version': '12.0.1.0.3', 'author': 'CorporateHub, ' 'Odoo Community Association (OCA)', diff --git a/account_bank_statement_import_online_transferwise/i18n/account_bank_statement_import_online_transferwise.pot b/account_bank_statement_import_online_transferwise/i18n/account_bank_statement_import_online_transferwise.pot index 58b0d392..807eb499 100644 --- a/account_bank_statement_import_online_transferwise/i18n/account_bank_statement_import_online_transferwise.pot +++ b/account_bank_statement_import_online_transferwise/i18n/account_bank_statement_import_online_transferwise.pot @@ -24,19 +24,19 @@ msgid "API key" msgstr "" #. module: account_bank_statement_import_online_transferwise -#: code:addons/account_bank_statement_import_online_transferwise/models/online_bank_statement_provider_transferwise.py:126 +#: code:addons/account_bank_statement_import_online_transferwise/models/online_bank_statement_provider_transferwise.py:131 #, python-format msgid "Ending balance unavailable" msgstr "" #. module: account_bank_statement_import_online_transferwise -#: code:addons/account_bank_statement_import_online_transferwise/models/online_bank_statement_provider_transferwise.py:245 +#: code:addons/account_bank_statement_import_online_transferwise/models/online_bank_statement_provider_transferwise.py:250 #, python-format msgid "Fee for %s" msgstr "" #. module: account_bank_statement_import_online_transferwise -#: code:addons/account_bank_statement_import_online_transferwise/models/online_bank_statement_provider_transferwise.py:276 +#: code:addons/account_bank_statement_import_online_transferwise/models/online_bank_statement_provider_transferwise.py:281 #, python-format msgid "No API key specified!" msgstr "" @@ -52,7 +52,7 @@ msgid "Profile" msgstr "" #. module: account_bank_statement_import_online_transferwise -#: code:addons/account_bank_statement_import_online_transferwise/models/online_bank_statement_provider_transferwise.py:250 +#: code:addons/account_bank_statement_import_online_transferwise/models/online_bank_statement_provider_transferwise.py:255 #, python-format msgid "Transaction fee for %s" msgstr "" diff --git a/account_bank_statement_import_online_transferwise/i18n/nl.po b/account_bank_statement_import_online_transferwise/i18n/nl.po new file mode 100644 index 00000000..81d3e506 --- /dev/null +++ b/account_bank_statement_import_online_transferwise/i18n/nl.po @@ -0,0 +1,61 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_bank_statement_import_online_transferwise +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-01-22 22:44+0000\n" +"Last-Translator: Bosd \n" +"Language-Team: none\n" +"Language: nl\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.3.2\n" + +#. module: account_bank_statement_import_online_transferwise +#: model_terms:ir.ui.view,arch_db:account_bank_statement_import_online_transferwise.online_bank_statement_provider_form +msgid "API base" +msgstr "API base" + +#. module: account_bank_statement_import_online_transferwise +#: model_terms:ir.ui.view,arch_db:account_bank_statement_import_online_transferwise.online_bank_statement_provider_form +msgid "API key" +msgstr "API Sleutel" + +#. module: account_bank_statement_import_online_transferwise +#: code:addons/account_bank_statement_import_online_transferwise/models/online_bank_statement_provider_transferwise.py:131 +#, python-format +msgid "Ending balance unavailable" +msgstr "Eindbalans is niet beschikbaar" + +#. module: account_bank_statement_import_online_transferwise +#: code:addons/account_bank_statement_import_online_transferwise/models/online_bank_statement_provider_transferwise.py:250 +#, fuzzy, python-format +msgid "Fee for %s" +msgstr "Transactievergoeding voor %s" + +#. module: account_bank_statement_import_online_transferwise +#: code:addons/account_bank_statement_import_online_transferwise/models/online_bank_statement_provider_transferwise.py:281 +#, python-format +msgid "No API key specified!" +msgstr "Geen API sleutel ingegeven!" + +#. module: account_bank_statement_import_online_transferwise +#: model:ir.model,name:account_bank_statement_import_online_transferwise.model_online_bank_statement_provider +msgid "Online Bank Statement Provider" +msgstr "Online Bankafschrift Provider" + +#. module: account_bank_statement_import_online_transferwise +#: model_terms:ir.ui.view,arch_db:account_bank_statement_import_online_transferwise.online_bank_statement_provider_form +msgid "Profile" +msgstr "Profiel" + +#. module: account_bank_statement_import_online_transferwise +#: code:addons/account_bank_statement_import_online_transferwise/models/online_bank_statement_provider_transferwise.py:255 +#, python-format +msgid "Transaction fee for %s" +msgstr "Transactievergoeding voor %s" diff --git a/account_bank_statement_import_online_transferwise/models/online_bank_statement_provider_transferwise.py b/account_bank_statement_import_online_transferwise/models/online_bank_statement_provider_transferwise.py index 4ed88c11..2006d880 100644 --- a/account_bank_statement_import_online_transferwise/models/online_bank_statement_provider_transferwise.py +++ b/account_bank_statement_import_online_transferwise/models/online_bank_statement_provider_transferwise.py @@ -14,6 +14,10 @@ import urllib.request from odoo import models, api, _ from odoo.exceptions import UserError +import logging +_logger = logging.getLogger(__name__) + + TRANSFERWISE_API_BASE = 'https://api.transferwise.com' @@ -30,6 +34,7 @@ class OnlineBankStatementProviderTransferwise(models.Model): url = api_base + '/v1/profiles' data = self._transferwise_retrieve(url, api_key) except: + _logger.warning('Unable to get profiles', exc_info=True) return [] return list(map( lambda entry: ( @@ -266,7 +271,7 @@ class OnlineBankStatementProviderTransferwise(models.Model): def _transferwise_retrieve(self, url, api_key): with self._transferwise_urlopen(url, api_key) as response: content = response.read().decode( - response.headers.get_content_charset() + response.headers.get_content_charset() or 'utf-8' ) return self._transferwise_validate(content)