[FIX] base_vat: no vat check if multiple countries

We should only check the consistency between the vat number and country code in
case we have one country involved in the recordset.

closes odoo/odoo#49530

X-original-commit: 23771ef7fcadfc0022d278c2e3436a7befc9e5b8
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
alt-odoo
2020-04-14 12:17:20 +00:00
parent 2ff76674d2
commit c3379312d9
+1 -1
View File
@@ -489,7 +489,7 @@ class ResPartner(models.Model):
return super(ResPartner, self).create(values)
def write(self, values):
if values.get('vat'):
if values.get('vat') and len(self.mapped('country_id')) == 1:
country_id = values.get('country_id', self.country_id.id)
values['vat'] = self._fix_vat_number(values['vat'], country_id)
return super(ResPartner, self).write(values)