Skip to content
Snippets Groups Projects
Commit af75bd6b authored by Juan Jose Scarafia's avatar Juan Jose Scarafia
Browse files

[FIX] l10n_ar: fix l10n_ar_currency_rate

If an invoice is posted, sended back to draft and the rate was change on res.currency, we preserve the value already existing on l10n_ar_currency_rate

closes odoo/odoo#77175

X-original-commit: 820df9ee
Signed-off-by: default avatarJosse Colpaert <jco@openerp.com>
parent 2cdfb780
Branches
Tags
No related merge requests found
......@@ -163,11 +163,10 @@ class AccountMove(models.Model):
for rec in ar_invoices:
rec.l10n_ar_afip_responsibility_type_id = rec.commercial_partner_id.l10n_ar_afip_responsibility_type_id.id
if rec.company_id.currency_id == rec.currency_id:
l10n_ar_currency_rate = 1.0
else:
l10n_ar_currency_rate = rec.currency_id._convert(
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)
rec.l10n_ar_currency_rate = l10n_ar_currency_rate
# We make validations here and not with a constraint because we want validation before sending electronic
# data on l10n_ar_edi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment