Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Argentina - Accounting

Entity: res.partner

Compute Method: _compute_l10n_ar_formatted_vat

Inputs Method Outputs
  • vat
""" This will add some dash to the CUIT number (VAT AR) in order to show in his natural format:
        {person_category}-{number}-{validation_number} """
recs_cuit = self.filtered(lambda p: p.l10n_ar_afip_code == AR_CUIT_AFIP_CODE and p.vat)
for rec in recs_cuit:
            try:
                rec.l10n_ar_formatted_vat = stdnum.ar.cuit.format(rec.vat)
            except Exception as error:
                rec.l10n_ar_formatted_vat = rec.vat
                _logger.runbot("Argentinean VAT was not formatted: %s", repr(error))
remaining = self - recs_cuit
remaining.l10n_ar_formatted_vat = False

Back to entity