Repository
odoo/odoo · module folder
Module version
2.0
Category
Accounting/Accounting
Folder size
0.67 MB
License
LGPL-3
Application
No
Auto-installable
No
Website
None
Last tracking update
2026-08-15 22:44:14
Authors
Odoo S.A.
Maintainers
Odoo S.A.
Committers
Xavier Morel, Xavier ALT, Josse Colpaert, Odoo Translation Bot, Joren Van Onder, Jairo Llopis, Julien Castiaux, Andrea Grazioso (agr-odoo), Tiffany Chang (tic), Gorash, William Braeckman, Stanislas Sobieski, william-andre, Louis Baudoux, nni-odoo, David, Mylyna Hy, Maximilien (malb), Yosua Nicolaus, Dylan Kiss (dyki), Paolo Gatti, Antoine Boonen, Antoine Dupuis (andu), Nicolas Viseur (vin), guva-odoo, dijo-odoo, hatr-odoo, Mathieu Coutant, Khumam Alzagim, Claire (clbr), Ricardo Gomes Rodrigues, Corentin Heinix (cohe), ppat-odoo, Carmine, Krzysztof Magusiak (krma), krip-odoo, utma-odoo, nsirjacobs, pssh-odoo, Ashish Nirmal
Odoo dependencies
Python dependencies
None
System dependencies
None
Required by
account_fiscal_position_vat_check, account_fiscal_position_vies_warning, intrastat_base, l10n_at, l10n_be, l10n_bg, l10n_cl, l10n_cy, l10n_cz, l10n_de, l10n_dk, l10n_dz, l10n_es, l10n_es_aeat_mod347, l10n_es_aeat_partner_check, l10n_es_facturae, l10n_es_partner, l10n_fi, l10n_fr_account, l10n_gr, l10n_hr, l10n_hu, l10n_id, l10n_ie, l10n_in, l10n_it, l10n_latam_base, l10n_latam_check, l10n_lu, l10n_lv, l10n_mr, l10n_mt, l10n_ng, l10n_nl, l10n_no, l10n_pe, l10n_ph, l10n_pl, l10n_pt, l10n_ro, l10n_rs, l10n_sa_edi, l10n_se, l10n_si, l10n_sk, l10n_tr_nilvera_base_vat, l10n_tw_edi_ecpay, l10n_uk, l10n_uz, l10n_za
Description
VAT validation for Partner's VAT numbers.
=========================================

After installing this module, values entered in the VAT field of Partners will
be validated for all supported countries. The country is inferred from the
2-letter country code that prefixes the VAT number, e.g. ``BE0477472701``
will be validated using the Belgian rules.

There are two different levels of VAT number validation:
--------------------------------------------------------
    * By default, a simple off-line check is performed using the known validation
      rules for the country, usually a simple check digit. This is quick and 
      always available, but allows numbers that are perhaps not truly allocated,
      or not valid anymore.

    * When the "VAT VIES Check" option is enabled (in the configuration of the user's
      Company), VAT numbers will be instead submitted to the online EU VIES
      database, which will truly verify that the number is valid and currently
      allocated to a EU company. This is a little bit slower than the simple
      off-line check, requires an Internet connection, and may not be available
      all the time. If the service is not available or does not support the
      requested country (e.g. for non-EU countries), a simple check will be performed
      instead.

Supported countries currently include EU countries, and a few non-EU countries
such as Chile, Colombia, Mexico, Norway or Russia. For unsupported countries,
only the country code will be validated.
    

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
res_config_settings_view_form res.config.settings.view.form.inherit.base.vat res.config.settings form Inherits account.res_config_settings_view_form
view_partner_base_vat_form view.partner.base.vat.form res.partner form Inherits base.view_partner_form
HTTP endpoints (1)
Route(s)HandlerAuthTypeMethodsFlags
/base_vat/1/webhook_update_vies BaseVatWebhookController.webhook_update_vies public http ALL csrf off
Models touched (4)

New fields (1)
  • vat_check_vies Boolean
    string='Verify VAT Numbers'
Public methods (0)

No public methods.

New fields (1)
  • vat_check_vies Boolean
    readonly=False related='company_id.vat_check_vies' string='Verify VAT Numbers'
Public methods (0)

No public methods.

New fields (1)
  • has_foreign_fiscal_position Boolean
    compute='_compute_has_foreign_fiscal_position'
Public methods (0)

No public methods.

New fields (4)
  • country_id Many2one
    inverse='_inverse_vat' store=True
  • perform_vies_validation Boolean
    compute='_compute_perform_vies_validation'
  • vat Char
    inverse='_inverse_vat' store=True
  • vies_valid Boolean
    compute='_compute_vies_valid' help='European VAT numbers are automatically checked on the VIES database.' readonly=False store=True string='Intra-Community Valid' tracking=True
Public methods (44)
  • check_vat_al(self, vat)
    Check Albania VAT number
  • check_vat_br(self, vat)
  • check_vat_ch(self, vat)
    Check Switzerland VAT number.
  • check_vat_cr(self, vat)
  • check_vat_de(self, vat)
  • check_vat_do(self, vat)
  • check_vat_ec(self, vat)
  • check_vat_gr(self, vat)
    Allows some custom test VAT number to be valid to allow testing Greece EDI.
  • check_vat_gt(self, vat)
    Allow some custom Guatemala NIT numbers to pass the test to be used for testing the Guatemalan EDI.
  • check_vat_hu(self, vat)
    Check Hungary VAT number that can be for example 'HU12345676 or 'xxxxxxxx-y-zz' or '8xxxxxxxxy' - For xxxxxxxx-y-zz, 'x' can be any number, 'y' is a number between 1 and 5 depending on the person and the 'zz' is used for region code. - 8xxxxxxxxy, Tin number for individual, it has to start with an 8 and finish with the check digit - In case of EU format it will be the first 8 digits of the full VAT
  • check_vat_id(self, vat)
    Temporary Indonesian VAT validation to support the new format introduced in January 2024.
  • check_vat_ie(self, vat)
  • check_vat_il(self, vat)
  • check_vat_in(self, vat)
  • check_vat_jp(self, vat)
  • check_vat_ma(self, vat)
  • check_vat_mx(self, vat)
    Mexican VAT verification Verificar RFC México
  • check_vat_no(self, vat)
    Check Norway VAT number.See http://www.brreg.no/english/coordination/number.html
  • check_vat_pe(self, vat)
  • check_vat_ph(self, vat)
  • check_vat_ro(self, vat)
    Check Romanian VAT number that can be for example 'RO1234567897 or 'xyyzzaabbxxxx' or '9000xxxxxxxx'. - For xyyzzaabbxxxx, 'x' can be any number, 'y' is the two last digit of a year (in the range 00…99), 'a' is a month, b is a day of the month, the number 8 and 9 are Country or district code (For those twos digits, we decided to let some flexibility to avoid complexifying the regex and also for maintainability) - 9000xxxxxxxx, start with 9000 and then is filled by number In the range 0...9 Also stdum also checks the CUI or CIF (Romanian company identifier). So a number like '123456897' will pass.
  • check_vat_rs(self, vat)
  • check_vat_ru(self, vat)
    Check Russia VAT number. Method copied from vatnumber 1.2 lib https://code.google.com/archive/p/vatnumber/
  • check_vat_sa(self, vat)
    Check company VAT TIN according to ZATCA specifications: The VAT number should start and begin with a '3' and be 15 digits long
  • check_vat_th(self, vat)
  • check_vat_tr(self, vat)
  • check_vat_tw(self, vat)
    Since Feb. 2025, due to the imminent exhaustion of the UBN numbers, the validation logic was changed from using a division by 10 for the final check to using a division by 5, making numbers that were previously invalid now valid. The stdnum implementation of the VAT validation is not up to date with this latest update, so we implement our own validation to support these new valid UBNs.
  • check_vat_ua(self, vat)
  • check_vat_uy(self, vat)
    Taken from python-stdnum's master branch, as the release doesn't handle RUT numbers starting with 22. origin https://github.com/arthurdejong/python-stdnum/blob/master/stdnum/uy/rut.py FIXME Can be removed when python-stdnum does a new release.
  • check_vat_uz(self, vat)
  • check_vat_ve(self, vat)
  • check_vat_vn(self, vat)
    VAT format validator for Vietnam. Supported formats: - 10-digit format (Enterprise tax ID): e.g., 0101243150 - 13-digit format with branch suffix: e.g., 0101243150-001 - 12-digit format (Personal ID / Citizen ID - CCCD): e.g., 079123456789 (used as tax ID for individuals from July 1st, 2025) Note: - stdnum.vn.mst.validate() currently only supports 10- and 13-digit VAT numbers - and does not accept the 12-digit personal tax ID (CCCD) format introduced from 01/07/2025. - This helper provides a lightweight format-level validator for use in the meantime. - Can be removed once stdnum.vn.mst adds CCCD support.
  • create(self, vals_list)
    @api.model_create_multi
  • format_vat_al(self, vat)
  • format_vat_ch(self, vat)
  • format_vat_cl(self, vat)
    It is better to always have the -
  • format_vat_co(self, vat)
    It is better to always have the -
  • format_vat_eu(self, vat)
  • format_vat_hu(self, vat)
    We put the - back as we require it for the EDI and the different parts will make it clear to the user
  • format_vat_is(self, vat)
  • format_vat_sm(self, vat)
  • format_vat_vn(self, vat)
    It is better to always have the -
  • is_valid_ruc_ec(self, vat)
  • write(self, vals)

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…