mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
[FIX] Simple VAT check after VIES check fails
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user