Tryton República Dominicana
República Dominicana

unpaismejor-currency-do (8.0.0)

Published 2026-08-16 21:52:38 -04:00 by unpaismejor

Installation

pip install --index-url https://code.unpaismejor.org.do/api/packages/tryton-do/pypi/simple/ --extra-index-url https://pypi.org/simple unpaismejor-currency-do

About this package

Dominican Republic currency rates for Tryton

Currency DO

Dominican Republic currency integration for Tryton 8.0.

The module extends the standard currency.cron model with a new source: Banco Central de la República Dominicana. It reads effective BCRD rates from a compatible HTTP API and converts them to the rate format expected by Tryton.

Tryton stores rates as target currency per one unit of the cron base currency. The BCRD API is expected to return DOP per one unit of the requested foreign currency. The module therefore calculates cross rates using DOP as pivot.

Configuration

Create or edit a currency cron and set:

  • Source: Banco Central de la República Dominicana
  • Currency: the base currency for Tryton rates, commonly DOP
  • Currencies: the target currencies to update
  • BCRD API Base URL: for example https://rates.joseagrc.com
  • BCRD Rate Type: normally Purchase
  • BCRD Fallback Policy: normally Previous Available

The API endpoint must respond to:

GET /rates/effective?date=YYYY-MM-DD&currency=USD&variant=STANDARD&fallback_policy=previous_available

The response must contain the selected rate field, for example:

.. code-block:: json

{ "rate_date": "2026-06-05", "currency_code": "USD", "currency_variant": "STANDARD", "purchase": "59.123456", "sale": null }

Currency Variants

By default, currencies are requested with variant STANDARD. Overrides can be configured with JSON:

.. code-block:: json

{"GBP": "SCOTLAND"}

or one mapping per line:

.. code-block:: text

GBP=SCOTLAND

Operational Note

The module uses the standard Tryton currency cron behavior. Pressing the run button processes pending dates based on last_update and the cron frequency; if there is no pending date, no API request is made.

The service configured in BCRD API Base URL is an API adapter compatible with this module. It is not part of Tryton and must be operated and secured separately. SSL verification should remain enabled in production.

Migration

This release uses only the public currency.cron extension mechanism from Tryton 8.0. Its fields are additive and existing BCRD cron records are kept when the module is upgraded. The module sets the symbol of the existing DOP currency to RD$ during activation or upgrade. It also applies the same symbol when DOP is imported after the module has been activated. The operation is idempotent and does not create or duplicate currency records.

After replacing the package, update the database with the standard Tryton module upgrade procedure and restart all Tryton workers. Existing cron credentials and scheduling data do not need to be recreated.

Requirements

Requires Python: >=3.10
Details
PyPI
2026-08-16 21:52:38 -04:00
74
Fundación Un País Mejor
GPL-3.0-or-later
29 KiB
Assets (2)
Versions (1) View all
8.0.0 2026-08-16