diff --git a/base_vat_optional_vies/models/res_partner.py b/base_vat_optional_vies/models/res_partner.py index 31d82cca2..775fa26a5 100644 --- a/base_vat_optional_vies/models/res_partner.py +++ b/base_vat_optional_vies/models/res_partner.py @@ -1,6 +1,7 @@ # Copyright 2015 Tecnativa - Antonio Espinosa # Copyright 2017 Tecnativa - David Vidal # Copyright 2019 FactorLibre - Rodrigo Bonilla +# Copyright 2022 Moduon - Eduardo de Miguel # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import api, fields, models @@ -29,6 +30,8 @@ class ResPartner(models.Model): # call simple_vat_check and thus the flag will be removed partner.update({"vies_passed": True}) res = super(ResPartner, self).vies_vat_check(country_code, vat_number) + if not res: + return self.simple_vat_check(country_code, vat_number) return res @api.constrains("vat", "country_id")