diff options
| author | Katherine Zaoral <kz@adhoc.com.ar> | 2020-07-28 14:38:13 +0000 |
|---|---|---|
| committer | Katherine Zaoral <kz@adhoc.com.ar> | 2020-07-31 09:10:06 +0000 |
| commit | c8b2434d6131837d2bcf1bfa5132ff8c13364142 (patch) | |
| tree | e2518ddcffc438e14e96fd1ef7d34065053b6a56 /addons/l10n_ar | |
| parent | d24e3e780ffc469921a7799905ca7cdfe6dc7e5c (diff) | |
[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>
Diffstat (limited to 'addons/l10n_ar')
| -rw-r--r-- | addons/l10n_ar/models/res_partner.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/l10n_ar/models/res_partner.py b/addons/l10n_ar/models/res_partner.py index 68bb218730b..416beaf1a4f 100644 --- a/addons/l10n_ar/models/res_partner.py +++ b/addons/l10n_ar/models/res_partner.py @@ -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 |
