Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMP] l10n_uy_currency_update: We change the last closing day and some changes in the views #269

Open
wants to merge 1 commit into
base: 18.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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