From 75c62022da97c20649a7f52b7d9cb8de3cb42307 Mon Sep 17 00:00:00 2001 From: Augusto Weiss Date: Thu, 13 Jan 2022 18:21:31 +0000 Subject: [PATCH] [FIX] l10n_ar: currency rate on post method The currency rate could be different if the invoice date is different that the accounting date Steps to reproduce: 1- Install l10n_ar 2- Create two different currency rate for foreign currency (i.e: Dollar) with also different Date 3- Create an invoice setting the currency as foreign currency (i.e: Dollar) Current behavior before PR: In page "Journal Items" could see that each account line use the currency rate defined by the accounting date, however the currency rate filed (which is not visible) is defined by the invoice date. Desired behavior after PR is merged: Use always the accounting date to set the currency rate + CLA signing Augusto Weiss closes odoo/odoo#83689 X-original-commit: 21692f28fd1db7097e1d4c23ce7dcbaa76936449 Signed-off-by: Josse Colpaert --- addons/l10n_ar/models/account_move.py | 2 +- doc/cla/corporate/adhoc.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/l10n_ar/models/account_move.py b/addons/l10n_ar/models/account_move.py index 4e6a7885605..fbd7e2d6794 100644 --- a/addons/l10n_ar/models/account_move.py +++ b/addons/l10n_ar/models/account_move.py @@ -164,7 +164,7 @@ class AccountMove(models.Model): 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.invoice_date or fields.Date.today(), round=False) + 1.0, rec.company_id.currency_id, rec.company_id, rec.date, round=False) # We make validations here and not with a constraint because we want validation before sending electronic # data on l10n_ar_edi diff --git a/doc/cla/corporate/adhoc.md b/doc/cla/corporate/adhoc.md index 447eb615c02..a11d4e30080 100644 --- a/doc/cla/corporate/adhoc.md +++ b/doc/cla/corporate/adhoc.md @@ -19,3 +19,4 @@ Bruno Zanotti bz@adhoc.com.ar https://github.com/Bruno-Zanotti Pablo Santiago Paez Sheridan pp@adhoc.com.ar https://github.com/PabloPaezSheridan Juan Ignacio Carreras jc@adhoc.com.ar https://github.com/jcadhoc Joel Zilli joz@adhoc.com.ar https://github.com/JoelZilli +Augusto Weiss awe@adhoc.com.ar https://github.com/augusto-weiss