Bosnian localization of "Odoo" open-source platform: Master Data v2 - Refactor bank data with AI 🤖
Bosnian version of this article / Bosanska verzija članka
Introduction
Banks in Bosnia and Herzegovina are regulated at entity level. Therefore, we refactored the l10n_ba module and extracted bank data into a new module l10n_ba_fbih_bank_data. The new module is not a pure data module as it also contains validation rules.
Phase 1: Analysis and planning
We started by analyzing the existing l10n_ba module structure:

Phase 2: Creating new module
We created a new module l10n_ba_fbih_bank_data with dependency on l10n_ba:

Commit and push changes:

Phase 3: Database backup
Before deployment, we created a backup of the production database:


Phase 4: Migration script
We created a migration script with pre_init_hook for existing systems:

How pre_init_hook works:

Phase 5: Deployment and synchronization
Refreshing symlinks for odoo_addons:

Adjusting rsync script for modules inside packages:

Phase 6: Data validation
Checking BIC codes in CSV file:

Bank data format:

Phase 7: Successful migration
Migration verification - XML IDs now belong to new module:

Adding “Banke FBiH” menu:

Phase 8: Adding validation rules
Creating models for validation - res_bank.py and res_partner_bank.py:

Updating CSV file with bank_code column (BUG!):

Claude AI lost context (compact memory):

Phase 9: Adding bank views
Creating XML view for bank display:

Updating manifest:

Commit and push changes:

Phase 10: Module upgrade on production
Running upgrade on production server:

Using colmena for deployment (lost memory - Claude wake up!):

Checking upgrade script:

Phase 11: Testing and verification
Verifying bank_code field:

Checking bank accounts:

Phase 12: Fixing reference issues
Finding lost bank references:

Updating bank accounts with correct references:

Verifying fixes:

Phase 13: Final deployment
Running final upgrade:

Checking module version:

Phase 14: Migration result
Successful migration - all records preserved:

Checking bank_code values:

Phase 15: Verification in Odoo interface
Checking module in Odoo:

List of installed modules:

Phase 16: Adding remaining banks
Upgrade with new banks:

Final list of banks with 3-digit codes:

Phase 17: Adding Razvojna banka FBiH
Updating CSV for Razvojna banka (code 195):

Complete list of banks with codes:

Final result
“Banke FBiH” menu with BIC codes display:

FBiH Banks List
| Code | Bank |
|---|---|
| 101 | Privredna banka Sarajevo |
| 102 | Union banka |
| 132 | NLB Banka |
| 134 | ASA Banka |
| 141 | Bosna Bank International |
| 154 | Intesa Sanpaolo |
| 161 | Raiffeisen Bank |
| 186 | ZiraatBank |
| 194 | ProCredit Bank |
| 195 | Razvojna banka FBiH |
| 199 | Sparkasse Bank |
| 306 | Addiko bank |
| 338 | UniCredit Bank |
Conclusion
This refactoring brings:
- Better organization - bank data is in a separate module
- Validation - 16-digit account number, 3-digit bank code
- Entity separation - ready for
l10n_ba_rs_bank_dataandl10n_ba_bd_bank_data - Backward compatibility - migration preserves existing data
GitHub
Note
The content of this article was mostly generated by Claude AI.
Ernad Husremović bring.out doo Sarajevo hernad@bring.out.ba