From bfedd5e4ec6fc86f51fc035bd16c4bce5f2d50dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Scarafia?= Date: Thu, 7 Sep 2023 11:12:01 -0300 Subject: [PATCH] [FIX] l10n_ar: fix consistency of l10n_ar_currency_rate Use the same method and date used to compute the rate on aml field currency_rate closes odoo/odoo#136230 X-original-commit: adae60fc532cf6a853815f840cb49e93eb008cb7 Signed-off-by: Josse Colpaert --- addons/l10n_ar/models/account_move.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/l10n_ar/models/account_move.py b/addons/l10n_ar/models/account_move.py index ad0c70e8c4a..1f1eca4b49b 100644 --- a/addons/l10n_ar/models/account_move.py +++ b/addons/l10n_ar/models/account_move.py @@ -163,8 +163,12 @@ class AccountMove(models.Model): if rec.company_id.currency_id == rec.currency_id: rec.l10n_ar_currency_rate = 1.0 elif not rec.l10n_ar_currency_rate: - rec.l10n_ar_currency_rate = rec.currency_id._convert( - 1.0, rec.company_id.currency_id, rec.company_id, rec.date, round=False) + rec.l10n_ar_currency_rate = self.env['res.currency']._get_conversion_rate( + from_currency=rec.currency_id, + to_currency=rec.company_id.currency_id, + company=rec.company_id, + date=rec.invoice_date, + ) @api.onchange('partner_id') def _onchange_afip_responsibility(self):