From fe2d43e222e037468ad2c9a4cd674a5e651e34d2 Mon Sep 17 00:00:00 2001 From: Maximiliano Mezzavilla Date: Thu, 5 Dec 2024 16:19:52 -0300 Subject: [PATCH] [IMP] l10n_uy_currency_update: We change the last closing day and some changes in the views Task: 43301 --- l10n_uy_currency_update/__manifest__.py | 2 +- l10n_uy_currency_update/models/res_currency.py | 6 +++++- l10n_uy_currency_update/views/res_currency_views.xml | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/l10n_uy_currency_update/__manifest__.py b/l10n_uy_currency_update/__manifest__.py index 3bda35cb..585b38f8 100644 --- a/l10n_uy_currency_update/__manifest__.py +++ b/l10n_uy_currency_update/__manifest__.py @@ -19,7 +19,7 @@ ############################################################################## { 'name': 'Uruguayan Currency Rate Update', - 'version': "18.0.1.0.0", + 'version': "18.0.1.1.0", 'countries': ['uy'], 'category': 'Localization/Uruguay', 'sequence': 14, diff --git a/l10n_uy_currency_update/models/res_currency.py b/l10n_uy_currency_update/models/res_currency.py index 2977dac3..feb5ed5a 100644 --- a/l10n_uy_currency_update/models/res_currency.py +++ b/l10n_uy_currency_update/models/res_currency.py @@ -28,9 +28,13 @@ def _compute_l10n_uy_bcu_have_code(self): def action_l10n_uy_get_bcu_rate(self): self.ensure_one() + wsdl = "https://cotizaciones.bcu.gub.uy/wscotizaciones/servlet/%s/service.asmx?WSDL" + date_api_client = Client(wsdl % 'awsultimocierre') + last_closing_date = date_api_client.service.Execute() rate = self.env['res.company']._parse_bcu_data(self) + if rate: - raise UserError(_('Fecha Ultimo Cierre: %s\nRate: %s' % (rate[self.name][1], rate[self.name][0]))) + raise UserError(_('Fecha Ultimo Cierre: %s\nRate: %s' % (last_closing_date, 1 / rate[self.name][0]))) else: raise UserError(_('No se encontro cotizacion para esta Moneda')) diff --git a/l10n_uy_currency_update/views/res_currency_views.xml b/l10n_uy_currency_update/views/res_currency_views.xml index 1805b11e..2b1b595d 100644 --- a/l10n_uy_currency_update/views/res_currency_views.xml +++ b/l10n_uy_currency_update/views/res_currency_views.xml @@ -9,8 +9,8 @@
-