[FIX] base_vat: fix constrains

The vat checking constrains uses both the country_id and the vat, but
was defined as depending only on the vat field
This commit is contained in:
RomainLibert
2019-07-16 09:58:17 +00:00
parent a203e5318e
commit cd2cdbb5ce
+1 -1
View File
@@ -150,7 +150,7 @@ class ResPartner(models.Model):
vat = country_code + vat
return vat
@api.constrains('vat')
@api.constrains('vat', 'country_id')
def check_vat(self):
if self.env.context.get('company_id'):
company = self.env['res.company'].browse(self.env.context['company_id'])