[FIX] l10n_ar: properly compute l10n_ar_vat field
Only compute l10n_ar_vat when this one is defined, if not then the field should not be computed. closes odoo/odoo#55246 X-original-commit: 4e2de8c858c2d55b227b8a2fd3f8226f9da91a9d Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
@@ -50,7 +50,7 @@ class ResPartner(models.Model):
|
||||
""" We add this computed field that returns cuit (VAT AR) or nothing if this one is not set for the partner.
|
||||
This Validation can be also done by calling ensure_vat() method that returns the cuit (VAT AR) or error if this
|
||||
one is not found """
|
||||
recs_ar_vat = self.filtered(lambda x: x.l10n_latam_identification_type_id.l10n_ar_afip_code == '80')
|
||||
recs_ar_vat = self.filtered(lambda x: x.l10n_latam_identification_type_id.l10n_ar_afip_code == '80' and x.vat)
|
||||
for rec in recs_ar_vat:
|
||||
rec.l10n_ar_vat = stdnum.ar.cuit.compact(rec.vat)
|
||||
remaining = self - recs_ar_vat
|
||||
|
||||
Reference in New Issue
Block a user