diff --git a/l10n_do_currency_update/__manifest__.py b/l10n_do_currency_update/__manifest__.py index 47cf35d..cc621e1 100644 --- a/l10n_do_currency_update/__manifest__.py +++ b/l10n_do_currency_update/__manifest__.py @@ -7,7 +7,7 @@ "website": "https://www.indexa.do", "category": "Accounting", "license": "LGPL-3", - "version": "15.0.1.0.0", + "version": "15.0.1.0.1", "depends": ["account"], "data": [ "data/ir_cron_data.xml", diff --git a/l10n_do_currency_update/data/ir_config_parameter_data.xml b/l10n_do_currency_update/data/ir_config_parameter_data.xml index ab98ac5..9b547b3 100644 --- a/l10n_do_currency_update/data/ir_config_parameter_data.xml +++ b/l10n_do_currency_update/data/ir_config_parameter_data.xml @@ -9,5 +9,10 @@ indexa.api.token false + + indexa.api.token.name + x-access-token + + \ No newline at end of file diff --git a/l10n_do_currency_update/models/res_company.py b/l10n_do_currency_update/models/res_company.py index c71ae42..12ab190 100644 --- a/l10n_do_currency_update/models/res_company.py +++ b/l10n_do_currency_update/models/res_company.py @@ -63,9 +63,12 @@ class ResCompany(models.Model): def get_currency_rates(self, params, token): api_url = self.env["ir.config_parameter"].sudo().get_param("indexa.api.url") + token_name = ( + self.env["ir.config_parameter"].sudo().get_param("indexa.api.token.name") + ) try: - response = requests.get(api_url, params, headers={"x-access-token": token}) + response = requests.get(api_url, params, headers={token_name: token}) except requests.exceptions.ConnectionError as e: _logger.warning(_("API requests return the following error %s" % e)) return {}