mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
[15.0][FIX] base_vat_optional_vies: ensure vies check do not block contact update
This commit is contained in:
@@ -29,6 +29,12 @@ class ResPartner(models.Model):
|
|||||||
# call simple_vat_check and thus the flag will be removed
|
# call simple_vat_check and thus the flag will be removed
|
||||||
partner.update({"vies_passed": True})
|
partner.update({"vies_passed": True})
|
||||||
res = super(ResPartner, self).vies_vat_check(country_code, vat_number)
|
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
|
return res
|
||||||
|
|
||||||
@api.constrains("vat", "country_id")
|
@api.constrains("vat", "country_id")
|
||||||
|
|||||||
Reference in New Issue
Block a user