[FIX]pms_l10n_es: required invoice partner fields aeat documentation & vat

This commit is contained in:
Darío Lodeiros
2022-10-28 09:08:00 +02:00
parent 6d48dfb9c1
commit 54b85c8ccc

View File

@@ -38,10 +38,11 @@ class ResPartner(models.Model):
return res
if not self.country_id or not self.city or not (self.street or self.street2):
return False
if self.country_id.code == "ES" and not self.vat:
return False
elif self.country_id.code != "ES" and not self.aeat_identification:
return False
if not self.vat:
if self.country_id.code == "ES":
return False
elif not self.aeat_identification:
return False
return True
def write(self, vals):