Skip to content
Snippets Groups Projects
Commit c88ded09 authored by Katherine Zaoral's avatar Katherine Zaoral
Browse files

[REF] l10n_ar: use same scheme toi _set_afip_responsibility after posted ar invoices


closes odoo/odoo#85876

Related: odoo/enterprise#25014
Signed-off-by: default avatarJosse Colpaert <jco@odoo.com>
parent 7e9bea43
No related branches found
No related tags found
No related merge requests found
......@@ -132,6 +132,12 @@ class AccountMove(models.Model):
if not rec.l10n_ar_afip_service_end:
rec.l10n_ar_afip_service_end = rec.invoice_date + relativedelta(day=1, days=-1, months=+1)
def _set_afip_responsibility(self):
""" We save the information about the receptor responsability at the time we validate the invoice, this is
necessary because the user can change the responsability after that any time """
for rec in self:
rec.l10n_ar_afip_responsibility_type_id = rec.commercial_partner_id.l10n_ar_afip_responsibility_type_id.id
def _set_afip_rate(self):
""" We set the l10n_ar_currency_rate value with the accounting date. This should be done
after invoice has been posted in order to have the proper accounting date"""
......@@ -184,9 +190,7 @@ class AccountMove(models.Model):
posted = super()._post(soft=soft)
posted_ar_invoices = posted & ar_invoices
for rec in posted_ar_invoices:
rec.l10n_ar_afip_responsibility_type_id = rec.commercial_partner_id.l10n_ar_afip_responsibility_type_id.id
posted_ar_invoices._set_afip_responsibility()
posted_ar_invoices._set_afip_rate()
posted_ar_invoices._set_afip_service_dates()
return posted
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment