[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 <jco@odoo.com>
This commit is contained in:
committed by
Katherine Zaoral
parent
97caeab30d
commit
bfedd5e4ec
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user