Germany - Leitweg-ID for XRechnung
by Odoo DevHouse https://apps.odoo.com/apps/modules/browse?author=Odoo%20DevHouse$ 99.00
Germany - Leitweg-ID for XRechnung
Give German public-sector customers a dedicated, validated Leitweg-ID field - and route every XRechnung e-invoice automatically, with no extra step at send time.
German federal, state and municipal customers (Bund, Länder, Kommunen) reject e-invoices that don't carry a correct Leitweg-ID - the routing code their back-office systems use to forward an incoming XRechnung to the right department. Out of the box, Odoo has no dedicated field for it:
- Users end up reusing the generic "Reference" field on the customer, with no indication of what format is expected
- No validation - a typo in the Leitweg-ID is only discovered when the public-sector customer's system bounces the invoice
- The Leitweg-ID has a mandatory, publicly specified check digit (KoSIT Format-Spezifikation v2.0.2) that nothing checks for you
- No automatic link between the field and the BuyerReference (BT-10) of the generated XRechnung XML
This module adds a dedicated Leitweg-ID field to the customer's Invoicing tab. Every value is checked against the exact grammar and check-digit algorithm published by KoSIT (the German Coordination Office for IT Standards) - format errors are caught immediately, on save, instead of after the invoice bounces back from the customer's system. Once set, the Leitweg-ID is used automatically as the BuyerReference of the XRechnung file generated for that customer via Odoo's standard "Send & Print" - no Peppol registration required.
- Dedicated Leitweg-ID Field - on the customer form, Invoicing tab, right next to the e-invoicing format
- Full Format Validation - checks the Grobadressierung (2-12 digits), optional Feinadressierung (up to 30 alphanumeric characters) and 2-digit Prüfziffer against the KoSIT grammar
- Real Check-Digit Verification - implements the ISO/IEC 7064 MOD 97-10 algorithm (the same family used for IBAN) exactly as specified in the official KoSIT Leitweg-ID Format-Spezifikation v2.0.2, verified against its own published worked example
- Automatic BuyerReference (BT-10) - the Leitweg-ID is injected into the XRechnung UBL XML automatically whenever that customer's invoice is sent
- No Peppol Activation Needed - works with Odoo's built-in XRechnung (UBL) e-invoicing format independently of any Peppol subscription
- Safe Fallback - customers without a Leitweg-ID keep Odoo's existing behaviour (partner reference, or "N/A") untouched
- Zero Core Overrides - a thin extension of the standard XRechnung builder; nothing in Odoo's own e-invoicing logic is replaced
1. The Leitweg-ID Field on the Customer's Invoicing Tab
A dedicated Leitweg-ID field appears in the Customer Invoices section, right on the standard Invoicing tab - with an inline example placeholder so nobody has to guess the format.
2. A Bad Check Digit Is Rejected Immediately
Typing 04011000-1234512345-99 (a wrong check digit) and saving triggers an immediate, specific error - explaining the expected format right there, instead of a silent bad value that only surfaces when the customer's system rejects the invoice.
3. The Correct Leitweg-ID Saves Cleanly - and Is Tracked
Correcting the check digit to 04011000-1234512345-06 (the official KoSIT spec example) saves without any error. The change is logged in the chatter automatically, since the field is tracked like any other important customer setting.
4. Invoice the Customer Exactly as Usual
With the customer's EDI Format set to Germany (XRechnung), a normal posted invoice needs nothing extra - no special fields to fill in, no separate export step.
5. "Send" Automatically Attaches the XRechnung XML
Odoo's standard Send action already lists an INV_2026_00001_xrechnung.xml attachment next to the PDF - generated automatically because of the customer's EDI Format, with no configuration added by this module.
6. The Leitweg-ID Lands in the XML's BuyerReference (BT-10)
Opening the generated XML confirms it: a real xrechnung_3.0 CustomizationID, and <cbc:BuyerReference>04011000-1234512345-06</cbc:BuyerReference> - exactly the Leitweg-ID entered on the customer, with zero manual steps at send time.
Public Sector Billing
Companies invoicing federal, state, or municipal German public bodies that mandate XRechnung with a valid Leitweg-ID.
B2G Suppliers & Contractors
Vendors and service providers who receive a Leitweg-ID from their public-sector client at the time of the order and need to store it reliably.
Compliance-Sensitive AP/AR Teams
Accounting teams that want e-invoices rejected by a bad Leitweg-ID caught in Odoo, not by the customer's inbound e-invoicing platform.
Step 1 - Open the Customer's Invoicing Tab
Open the public-sector customer's contact form and go to the Invoicing tab, in the Customer Invoices group.
Step 2 - Enter the Leitweg-ID
Paste the Leitweg-ID the customer provided (e.g. 04011000-1234512345-06) into the new Leitweg-ID field. If it doesn't match the official format or its check digit is wrong, Odoo blocks the save with a clear error instead of letting a bad value through.
Step 3 - Set the E-Invoicing Format to XRechnung
Set the customer's EDI Format to Germany (XRechnung), as usual - this module doesn't change how that format is selected.
Step 4 - Invoice Normally
Create and send the invoice through Send & Print as usual. The generated XRechnung XML carries the Leitweg-ID as its BuyerReference automatically - nothing else to configure.
Pro Tip - Regenerating a File
If the Leitweg-ID was added after an XRechnung file was already generated, just re-run Send & Print on the invoice to regenerate it with the correct BuyerReference.
Need Help or Want a Custom Feature?
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Invoicing (account)
• Discuss (mail) |
| Lines of code | 55 |
| Technical Name |
l10n_de_leitweg_id |
| License | OPL-1 |
| Website | https://apps.odoo.com/apps/modules/browse?author=Odoo%20DevHouse |
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