Skip to content

Commit

Permalink
[FIX] base_vat: accept XI VAT format
Browse files Browse the repository at this point in the history
Following Brexit on January 1st 2021, companies in Northern Ireland have
a new VAT number starting with XI instead of GB. More info:
https://www.gov.uk/government/publications/accounting-for-vat-on-goods-moving-between-great-britain-and-northern-ireland-from-1-january-2021/check-when-you-are-trading-under-the-northern-ireland-protocol-if-you-are-vat-registered-business

stdnum support the new XI VAT from 1.16
arthurdejong/python-stdnum@b93d695
This patch add temporary support in base_vat until the new version
is available on the Debian package repository

Community tracked issue
#64891

opw-2461322

closes #67064

Signed-off-by: William André (wan) <wan@odoo.com>
  • Loading branch information
agr-odoo committed Mar 2, 2021
1 parent c6babb3 commit 5d0fb2f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion addons/base_vat/models/res_partner.py
Expand Up @@ -47,7 +47,7 @@
'es': 'ESA12345674',
'fi': 'FI12345671',
'fr': 'FR32123456789',
'gb': 'GB123456782',
'gb': 'GB123456782 or XI123456782',
'gr': 'GR12345670',
'hu': 'HU12345676',
'hr': 'HR01234567896', # Croatia, contributed by Milan Tribuson
Expand Down Expand Up @@ -430,3 +430,10 @@ def check_vat_ua(self, vat):
else:
res.append(False)
return all(res)

def check_vat_xi(self, vat):
""" Temporary Nothern Ireland VAT validation following Brexit
As of January 1st 2021, companies in Northern Ireland have a
new VAT number starting with XI
TODO: remove when stdnum is updated to 1.16 in supported distro"""
return stdnum.util.get_cc_module('gb', 'vat').is_valid(vat) if stdnum else True

0 comments on commit 5d0fb2f

Please sign in to comment.