[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:
@@ -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'])
|
||||
|
||||
Reference in New Issue
Block a user