Tunisian VAT Validation
Comprehensive and secure Tunisian VAT number validation for Odoo 18
Validate Tunisian Tax Registration Numbers
Tunisian VAT Validation ensures compliance with Tunisian tax regulations by validating VAT (Tax Identification Number) numbers directly inside Odoo 18. The module supports both simple (7 digits + key letter) and complete (with situation, category, establishments) formats using the official Tunisian fiscal algorithm — no external API calls required.
Key Highlights
Key Letter Algorithm
Automatic calculation and verification of the Tunisian fiscal key letter using the official weighted sum algorithm — decreasing weights 7 to 1, modulo 23, mapped to a 23-letter alphabet (without I, O, U).
Two VAT Formats
Supports both simple format (1234567P) and complete format (1234567P/A/M/000) with automatic detection of the format type via a computed stored field.
Situation & Category Validation
Validates VAT situation codes (A, B, P, F, N, D) and activity categories (M, C, P, N) with detailed error messages. Handles swapped segment order for Taxi-specific matricule formats.
Automatic & Manual Validation
VAT is validated automatically on partner creation or modification via
@api.constrains. A manual button on the partner form and a
standalone wizard provide on-demand validation.
base_vat Override
Automatically disables the standard base_vat validation for Tunisian partners and applies the dedicated Tunisian validation algorithm instead, preventing false negatives.
Offline & Instant
Purely algorithmic validation with no external API calls. Works offline, returns instant results, and includes 13 comprehensive unit tests covering key letter, formats, codes, and partner creation.
Supported VAT Formats
The module validates two Tunisian VAT formats with full key letter verification.
Simple Format
1234567P
7 digits + 1 key letter calculated via the Tunisian fiscal algorithm.
- Positions 1-7: Identification number (7 digits)
- Position 8: Key letter (algorithmic check digit)
Complete Format
1234567P/A/M/000
Extended format with situation, category, and secondary establishments.
- Segment 1: Key letter (algorithmic)
- Segment 2: VAT situation (A/B/P/F/N/D)
- Segment 3: Activity category (M/C/P/N)
- Segment 4: Establishments (3 digits)
Tunisian Tax Codes
Official VAT situation codes and activity categories used in the complete format.
| A | Mandatory taxpayer |
| B | Voluntary taxpayer |
| P | Partial taxpayer |
| F | Flat-rate taxpayer |
| N | Non-taxpayer |
| D | Special regime / Customs |
| M | Legal entity |
| C | Individual trader or industrial |
| P | Individual liberal profession |
| N | Employer not subject to taxes |
How to Use Tunisian VAT Validation
From installation to validating VAT numbers in three simple steps.
Install the Module
Install Tunisian VAT Validation from the Odoo Apps menu. The module depends on base_vat and contacts, and automatically disables the standard VAT validation for Tunisian partners.
Validate a VAT Number
Two ways to validate:
- From a partner form: Open a Tunisian contact, enter the VAT, and click "Validate Tax Registration"
- From the wizard: Go to Administration → VAT Validation, enter any VAT number, and click "Validate"
Read the Result
Validation results are displayed immediately:
- Success: A green notification confirms the VAT is valid. The format type (simple/complete) is stored on the partner.
- Error: A red notification shows the exact reason (invalid key letter, wrong situation code, unrecognized format, etc.)
- Validation status fields (
tn_vat_validated,tn_vat_validation_error) are visible on the partner's "Tunisian Tax Registration" page.
Technical Information
| Version | 18.0.1.0.0 |
| Author | BIZUP |
| License | LGPL-3 |
| Category | Localization |
| Website | www.bizup.tn |
| Dependencies | base base_vat contacts |
| Odoo Version | 18.0 Community |
Our Odoo Services
BIZUP is a dynamic Tunisian startup specialized in digital transformation and Odoo ERP solutions.
We bring energy and expertise to accelerate your company's growth.
End-to-end ERP integration adapted to your business processes.
Custom module development for your specific needs.
Migration to the latest Odoo versions with no data loss.
Comprehensive training programs to master Odoo as a team.
Need Help?
For support, customization requests, or any questions about this module, our team is at your service.
Avenue Commandant Bejaoui, Immeuble El Hafianne Bloc A, 4000 Sousse, Tunisia
we help you grow
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Contacts (contacts)
• Discuss (mail) • Invoicing (account) |
| Lines of code | 348 |
| Technical Name |
tn_vat_validation |
| License | LGPL-3 |
| Website | https://www.bizup.tn |
Please log in to comment on this module