Skip to content

Commit

Permalink
[IMP] l10n_uy_currency_update: We change the last closing day and som…
Browse files Browse the repository at this point in the history
…e changes in the views

Task: 43301
  • Loading branch information
mem-adhoc committed Dec 12, 2024
1 parent 59a75c7 commit 83a5908
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion l10n_uy_currency_update/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 5 additions & 1 deletion l10n_uy_currency_update/models/res_currency.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))

Expand Down
4 changes: 2 additions & 2 deletions l10n_uy_currency_update/views/res_currency_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<field name="name" position="after">
<field name="l10n_uy_have_bcu_code" invisible='True'/>
<div colspan="2">
<button name="action_l10n_uy_get_bcu_rate" string="⇒ (UY) Mostrar ultima cotización BCU" invisible="not l10n_uy_have_bcu_code or is_current_company_currency" type="object" class="oe_link" help="Este boton permitira traer la última cotinzación de BCU para esta moneda."/>
<button name="action_get_available_currencies" invisible="l10n_uy_have_bcu_code" type="object" class="btn-link" string="⇒ (UY) Obtener info monedas disponibles"/>
<button name="action_l10n_uy_get_bcu_rate" string="⇒ (UY) Mostrar ultima cotización BCU" invisible="not l10n_uy_have_bcu_code or is_current_company_currency or 'UY' not in fiscal_country_codes" type="object" class="oe_link" help="Este boton permitira traer la última cotinzación de BCU para esta moneda."/>
<button name="action_get_available_currencies" invisible="l10n_uy_have_bcu_code or 'UY' not in fiscal_country_codes" type="object" class="btn-link" string="⇒ (UY) Obtener info monedas disponibles"/>
</div>
</field>
</field>
Expand Down

0 comments on commit 83a5908

Please sign in to comment.