EuroZipTowns
Postcodes and towns for Dolibarr — five countries, the town appears from the postcode
Dolibarr 19+ (Modul) · Version 2.0
Dolibarr can complete town names from the postcode — only the dictionary is empty. The table ships with it but is never filled, and it cannot even be edited through Setup → Dictionaries. Whoever wants to fill it finds instructions in the documentation for copying SQL statements into the database. That is tedious, error-prone, and starts over again with the next installation.
This module does it on activation, for five countries:
| Country | Rows | Source |
|---|---|---|
| Switzerland | 4,451 | Swiss Post |
| Germany | 14,976 | GeoNames |
| Austria | 4,391 | GeoNames |
| Italy | 18,415 | GeoNames |
| France | 37,202 | GeoNames |
Countries are picked one by one on the setup page. Only what is ticked gets loaded — clearing a country removes its rows again on save. After that, typing the postcode in any address field — for business partners, contacts, invoices, delivery addresses — is enough and the town appears.
The work is in the data, not in the import
One dataset per country is quickly downloaded. That does not make it usable: GeoNames means something different by the same column in every country, and a single shared rule produces nonsense in at least three of them.
- Germany — 6,819 rows are bulk-recipient postcodes whose "town" is in fact a company: "Commerzbank AG", "Daimler AG, NL Berlin". They are recognisable by a numeric region code where real towns carry the abbreviation of the federal state — far more reliable than guessing from the name. Districts are folded into their town: 15848 then yields 7 towns instead of 55.
- Austria — every cadastral municipality is listed as its own town there; 9560 alone has 131 of them. The municipality is used instead, which leaves the 7 real towns. Vienna is handled separately, because the town would otherwise read "Gemeindebezirk Innere Stadt" instead of simply "Wien".
- France — the 14,346 CEDEX codes are dropped; nobody types them into an address field, and they do not fit a ten-character column anyway. So are the arrondissement duplicates, "Paris 01" next to "Paris". What remains are 37,202 rows — in line with the official list of La Poste.
- Italy — there is no municipality column here into which frazioni could be folded. The town names are therefore kept as they come; in South Tyrol a single postcode still lists many hamlets.
- Switzerland — here GeoNames is not used at all, but the list of the Swiss Post.
Finally every dataset is validated against the shape of its country's postcode. That removes the last oddities — the ministry codes and the pickup points — and makes sure nothing is written that does not fit the column in the first place.
Cleanly gone again
Every row entered is marked. Clearing a country or deactivating the module removes exactly those rows again; whatever reached the dictionary by other means stays untouched. That is the difference to an SQL import: that cannot be undone without knowing yourself what you inserted.
A country that is switched on is also set active in the country dictionary — the query behind the completion only asks active countries, and without that the list would silently stay empty. That flag is left alone when the country is cleared again: switching off a country somebody may have activated themselves would be the more surprising of the two.
Moving over from Swiss Zip & Towns
This module is the successor and declares a conflict with the old one. Deactivate the old one first — that takes its rows with it — then activate this one and select Switzerland. You get the same data back, from the same source.
Setup page
Under Setup → Modules → European postcodes & towns every country has a line showing how many entries are available and how many are loaded, and whether the country was found in the dictionary at all. From there you can re-import, remove everything and switch the completion on and off — without deactivating the module.
Your own data
The lists sit in the module as data/ziptowns_<country>.csv, tab separated: postcode, tab, town. Tab and not comma, because German and Austrian place names contain commas. Lines starting with # are skipped. To use a newer or your own list, replace the file and press re-import. The script that builds the datasets from the GeoNames dumps is included as well.
Requirements
- Dolibarr 19 or newer. Tested with 23.0.x.
- No additional PHP package, no external request at runtime — the lists are in the module.
- Interface in German, French, Italian and English.
Licence
GPL-3.0-or-later, as Dolibarr modules have to be. You may use the module in as many of your own installations as you like, modify it and pass it on; the source is included. What is paid for is the finished, tested packaging together with the prepared data — not the right to it. Where the data comes from is stated in the NOTICE file in the package.
Help and documentation for EuroZipTowns →
- 79,435 official postcodes and towns from five countries
- Country by country — only what you pick gets loaded
- Type the postcode, the town appears — in every address field
- Cleaned per country instead of imported raw
- Removed without a trace when cleared or deactivated
- German, French, Italian and English