[FIX] account_bank_statement_import_online_transferwise: charset

This commit is contained in:
Alexey Pelykh
2020-10-22 14:34:17 +03:00
committed by Emanuel Cino
parent e2b6c60d27
commit c63a31d5ab
4 changed files with 72 additions and 6 deletions

View File

@@ -4,7 +4,7 @@
{ {
'name': 'Online Bank Statements: TransferWise.com', 'name': 'Online Bank Statements: TransferWise.com',
'version': '12.0.1.0.2', 'version': '12.0.1.0.3',
'author': 'author':
'CorporateHub, ' 'CorporateHub, '
'Odoo Community Association (OCA)', 'Odoo Community Association (OCA)',

View File

@@ -24,19 +24,19 @@ msgid "API key"
msgstr "" msgstr ""
#. module: account_bank_statement_import_online_transferwise #. 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 #, python-format
msgid "Ending balance unavailable" msgid "Ending balance unavailable"
msgstr "" msgstr ""
#. module: account_bank_statement_import_online_transferwise #. 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 #, python-format
msgid "Fee for %s" msgid "Fee for %s"
msgstr "" msgstr ""
#. module: account_bank_statement_import_online_transferwise #. 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 #, python-format
msgid "No API key specified!" msgid "No API key specified!"
msgstr "" msgstr ""
@@ -52,7 +52,7 @@ msgid "Profile"
msgstr "" msgstr ""
#. module: account_bank_statement_import_online_transferwise #. 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 #, python-format
msgid "Transaction fee for %s" msgid "Transaction fee for %s"
msgstr "" msgstr ""

View File

@@ -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 <c5e2fd43-d292-4c90-9d1f-74ff3436329a@anonaddy.me>\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"

View File

@@ -14,6 +14,10 @@ import urllib.request
from odoo import models, api, _ from odoo import models, api, _
from odoo.exceptions import UserError from odoo.exceptions import UserError
import logging
_logger = logging.getLogger(__name__)
TRANSFERWISE_API_BASE = 'https://api.transferwise.com' TRANSFERWISE_API_BASE = 'https://api.transferwise.com'
@@ -30,6 +34,7 @@ class OnlineBankStatementProviderTransferwise(models.Model):
url = api_base + '/v1/profiles' url = api_base + '/v1/profiles'
data = self._transferwise_retrieve(url, api_key) data = self._transferwise_retrieve(url, api_key)
except: except:
_logger.warning('Unable to get profiles', exc_info=True)
return [] return []
return list(map( return list(map(
lambda entry: ( lambda entry: (
@@ -266,7 +271,7 @@ class OnlineBankStatementProviderTransferwise(models.Model):
def _transferwise_retrieve(self, url, api_key): def _transferwise_retrieve(self, url, api_key):
with self._transferwise_urlopen(url, api_key) as response: with self._transferwise_urlopen(url, api_key) as response:
content = response.read().decode( content = response.read().decode(
response.headers.get_content_charset() response.headers.get_content_charset() or 'utf-8'
) )
return self._transferwise_validate(content) return self._transferwise_validate(content)