| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Discuss (mail)
• Invoicing (account) |
| Lines of code | 2896 |
| Technical Name |
l10n_sa_zatca_einvoice |
| License | OPL-1 |
| Website | https://gencbaris.com |
| Versions | 18.0 19.0 |
Saudi Arabia ZATCA Phase 2 E-Invoicing for Odoo 18 & 19
End-to-end FATOORAH integration: UBL 2.1, XAdES B-B signatures, QR TLV, Clearance + Reporting API.
OPL-1 Odoo 18 + 19 Bilingual AR / EN Sandbox & Production
What is ZATCA Phase 2?
The Saudi Zakat, Tax and Customs Authority (ZATCA) has required Phase 2 ("Integration") e-invoicing since January 2023. Every invoice issued in the Kingdom must be generated as a signed UBL 2.1 XML document, hashed and chained with the previous invoice's hash, stamped with a TLV-encoded QR code, and either cleared in real time (B2B) or reported within 24 hours (B2C) to ZATCA's FATOORAH platform.
This module delivers the full pipeline natively inside Odoo: from generating the EC P-256 key pair and CSR, through OTP-based onboarding to /compliance/csid, running all 12 mandatory compliance scenarios, retrieving the Production CSID, and finally signing and dispatching every customer invoice without leaving the Odoo UI.
Key Features
How Onboarding Works
- Open Accounting -> Configuration -> ZATCA -> Onboarding and fill in the company's VAT (15 digits, starts with 3), CR (10 digits), and EGS Common Name.
- Click "Generate CSR" - an EC P-256 key pair plus a ZATCA-compliant CSR are generated and stored on the device.
- Log into the ZATCA portal at fatoora.zatca.gov.sa, choose "Onboard new device", copy the 6-digit OTP.
- Paste the OTP into Step 3 - the module exchanges CSR + OTP for the Compliance CSID.
- Step 4 runs the 12 mandatory compliance scenarios automatically.
- Step 5 exchanges the Compliance CSID for the Production CSID. The device is now production-ready.
Compliance Scenarios Covered
| # | Scenario | Type |
|---|---|---|
| 1 | Standard Tax Invoice | B2B |
| 2 | Standard Credit Note | B2B |
| 3 | Standard Debit Note | B2B |
| 4 | Simplified Tax Invoice | B2C |
| 5 | Simplified Credit Note | B2C |
| 6 | Simplified Debit Note | B2C |
| 7 | Multi-line Invoice | Any |
| 8 | Invoice with Allowance | Any |
| 9 | Invoice with Charge | Any |
| 10 | Invoice with Multiple Tax Categories | Any |
| 11 | Export Invoice (Zero-rated) | Any |
| 12 | Exempt Invoice | Any |
What is Inside
- Pure-Python UBL 2.1 invoice generator (cryptography + lxml)
- XAdES B-B XML digital signer with EC P-256
- ZATCA-compliant CSR builder with the full set of mandatory OIDs and ZATCA custom OIDs
- TLV / Base64 QR encoder (5-field B2C, 9-field B2B)
- HTTP client for Compliance CSID, Production CSID, Clearance, Reporting and Compliance test invoice endpoints
- Account.move post hook: hash, chain, sign, QR, submit - automatic on every customer invoice
- Onboarding wizard and compliance-check wizard
- Bilingual A4 + 80 mm thermal QWeb reports with embedded QR
- Customer portal endpoints for XML / QR download
- Comprehensive AR + EN translation .po files
- Multi-company record rules and dedicated ZATCA security groups
Frequently Asked Questions
Does the module work with Odoo 18 and Odoo 19?
Yes - separate 18.0 and 19.0 branches are maintained. Each carries the appropriate manifest version.
Does it require an internet connection?
Yes - to dispatch invoices to ZATCA Clearance and Reporting endpoints. Failed submissions are stored locally and retried by the cron every 30 minutes.
Does it support multi-company?
Yes. Each Odoo company has its own ZATCA device record with its own CSR, CSID and PIH chain.
Is the QR code valid for ZATCA's official validator app?
Yes. The TLV layout follows ZATCA's Detailed Technical Guideline v3 exactly: 5 mandatory fields for Simplified invoices, 9 fields including XML hash + signature + public key + stamp digest for Standard invoices.
What licence is the module released under?
OPL-1 (Odoo Proprietary License).
Requirements
- Odoo 18.0 or 19.0 Community / Enterprise
- Python: lxml, cryptography, qrcode, requests, Pillow
- Saudi Arabian company with a 15-digit VAT registration
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module