2
0

[15.0][FIX] base_vat_optional_vies: ensure vies check do not block contact update

This commit is contained in:
AaronHForgeFlow 2022-01-05 08:08:31 +01:00 committed by Rodrigo
parent 13d8ad43f6
commit 0dc3b1e965

View File

@ -29,6 +29,12 @@ 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 res is False:
if partner:
partner.update({"vies_passed": False})
return self.simple_vat_check(country_code, vat_number)
elif partner:
partner.update({"vies_passed": True})
return res
@api.constrains("vat", "country_id")