Tunisia Tax Pack - Timbre Fiscal, Retenue a la Source Certificate and TEJ XML
by Modvanta https://modvantaapps.tech
Odoo
$ 18.94

Tunisia Tax Pack: timbre fiscal, retenue a la source certificates and the TEJ XML file
Pack fiscal Tunisie: timbre fiscal, certificats de retenue a la source et fichier XML TEJ
Written and supported by Modvanta - modvantaapps@gmail.com
What it does
Three jobs Tunisian accountants do every month, inside Odoo: add the 1 dinar stamp to invoices, withhold the retenue a la source when paying suppliers, and send the certificates to TEJ.
| Timbre fiscal once per invoice: Odoo's Tunisian chart has the stamp as a fixed tax, which counts it again on every line. This pack adds one stamp line per customer invoice instead, with the amount and account you set (1.000 DT on 4371 by default). | |
| Per customer choice: Stamp every customer by default, or only some. A customer marked Exempt never gets it. Changing the customer on a draft adds or removes the line. | |
| Credit notes left alone: No stamp is added to a credit note. A full reversal keeps the stamp line, so the credit note still matches the invoice. | |
| Retenue a la source on payments: Built on Odoo's own Withholding Tax on Payment engine. Pick the RS tax in the payment dialog and the retenue is computed on the TTC amount paid. | |
| TEJ operation codes: Each withholding tax carries its TEJ code (RS7_000001, RS2_000002...). One button creates the usual rates: 1.5%, 1% and 0.5% on purchases of 1,000 D or more, 3% and 10% fees, 10% rents and more. | |
| Certificat de retenue: Numbered per company and year (0001/2026, 0002/2026...) when the payment is confirmed, printable from the payment. | |
| Monthly TEJ XML: Load the certificates of the month, generate the file, download it. Added, modified and cancelled certificates go in the right section, and the file is named MATRICULE-YEAR-MONTH-ACT.xml. | |
| Checked before you upload: The file is validated against the TEJ schemas published by the Ministry of Finance before you can download it. Missing e-mails, CIN numbers or birth dates are listed by name. |
Who it is for
| Tunisian companies on Odoo 19: Any company that pays suppliers, consultants or landlords and has to hand out retenue certificates. | |
| Accounting firms: Firms that prepare the monthly TEJ file for several clients, one company per client. | |
| Distributors and retailers: Businesses that issue many small invoices and need the stamp right on each one. |
Key features
Every screen below comes from a test database with the demo data of the pack.
One stamp line per invoice
A customer invoice with several lines and quantities still gets one Droit de timbre line of 1.000 DT, without VAT, on the stamp account.

Retenue in the payment dialog
Choose the Retenue a la source tax and a withholding line is added with the TTC amount as base. The net amount to pay is shown before you confirm.

Certificate number on the payment
Confirming the payment gives it the next certificate number and sets its TEJ status to To declare.

Certificat de retenue a la source
Payer and beneficiary with their identifiers, the operation and its TEJ code, HT, VAT, TTC, rate, retenue and net amount served, with room for the stamp and signature.

All certificates and their TEJ status
To declare, declared, to modify or to cancel. Filter what is still missing from TEJ.

Monthly TEJ declaration
Pick the year and month, load the certificates, generate the XML. A rectificative file is proposed when certificates must be modified or cancelled.

The TEJ file
Amounts in millimes, dates as DD/MM/YYYY, the beneficiary identified by matricule fiscal, CIN, passport or residence card, exactly as the TEJ schema expects.

Partner identity for TEJ
Identifier type, CIN or passport number, date of birth, category PP or PM, residence and activity. The matricule fiscal is read from the Tax ID.

Withholding tax with its TEJ code
A normal Odoo withholding tax with two extra fields: the TEJ operation code and, for retenue on VAT, the RSTVA25 or RSTVA100 code.

Settings
Stamp on or off, amount, default policy, accounts, stamp on vendor bills, your TEJ category and the button that creates the withholding taxes.

How it works
| 1 | Install the pack on a company that uses the Tunisian chart of accounts and set your Tax ID (matricule fiscal). |
| 2 | In Accounting settings, turn on the timbre fiscal and press Create Tunisian withholding taxes. |
| 3 | Invoice as usual: each customer invoice gets its stamp line, except for exempt customers. |
| 4 | Pay a supplier bill, pick the retenue a la source tax and confirm. The payment gets its certificate number. |
| 5 | Print the certificate for the supplier from the payment. |
| 6 | At month end open TEJ declarations, load the certificates, generate the XML and upload it on TEJ. Then mark it as submitted. |
Settings
| Timbre fiscal amount: 1.000 DT by default. Change it when the finance law changes it. | |
| Stamp every customer by default: Off means only customers set to Apply get the stamp. | |
| Stamp accounts: 4371 for invoices and 6654 for bills are used when you leave them empty. | |
| Timbre fiscal on vendor bills: Adds the stamp to bills of suppliers set to Apply. | |
| TEJ category: PM (company) or PP (individual) for your own declarant block. |
FAQ
Does it upload the file to TEJ for me?
No. You download the XML from Odoo and upload it on the TEJ website yourself. Odoo checks the file against the TEJ schema first.
Which rates does the button create?
The rates of the droit commun table in the TEJ specification for the most common operations. You can edit any rate or add other codes: all 47 TEJ operation codes are in the list.
Can I correct a certificate after it was declared?
Yes. Press Send again to TEJ on the payment and it goes in the next file as a modification. Cancelling a declared payment puts it in the cancellation section.
Does it make TEIF / El Fatoora e-invoices?
No. This pack covers the stamp, the retenue a la source and TEJ. It does not build TEIF invoices.
Does it need the Tunisian chart of accounts?
Yes. It depends on Odoo's Tunisia - Accounting module and on Withholding Tax on Payment, both part of Odoo.
Compatibility
Odoo 19, Community and Enterprise. Depends on Invoicing, Tunisia - Accounting and Withholding Tax on Payment. Multi-company: declarations belong to a company and users only see their own companies.
Support
Questions, a bug or a feature you need? Write to modvantaapps@gmail.com.
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Invoicing (account)
• Discuss (mail) |
| Lines of code | 1209 |
| Technical Name |
mdv_tn_tax_pack |
| License | OPL-1 |
| Website | https://modvantaapps.tech |
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