Bosnian localization of "Odoo" open-source platform: Master Data v2 - Refactor bank data with AI 🤖


Bosnian version of this article / Bosanska verzija članka

Previous article: Master Data

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:

l10n_ba module analysis

Phase 2: Creating new module

We created a new module l10n_ba_fbih_bank_data with dependency on l10n_ba:

Creating new module

Commit and push changes:

Commit changes

Phase 3: Database backup

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

Database backup

Backup completed successfully

Phase 4: Migration script

We created a migration script with pre_init_hook for existing systems:

Creating migration script

How pre_init_hook works:

pre_init_hook explanation

Phase 5: Deployment and synchronization

Refreshing symlinks for odoo_addons:

Refresh symlinks

Adjusting rsync script for modules inside packages:

Rsync script

Phase 6: Data validation

Checking BIC codes in CSV file:

BIC validation

Bank data format:

Bank data format

Phase 7: Successful migration

Migration verification - XML IDs now belong to new module:

Migration verification

Adding “Banke FBiH” menu:

Adding menu

Phase 8: Adding validation rules

Creating models for validation - res_bank.py and res_partner_bank.py:

Creating models

Updating CSV file with bank_code column (BUG!):

Updating CSV

Claude AI lost context (compact memory):

Compacting CSV

Phase 9: Adding bank views

Creating XML view for bank display:

Creating view

Updating manifest:

Updating manifest

Commit and push changes:

Commit view changes

Phase 10: Module upgrade on production

Running upgrade on production server:

Upgrade on production

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

Colmena deployment

Checking upgrade script:

Checking script

Phase 11: Testing and verification

Verifying bank_code field:

Verifying bank_code

Checking bank accounts:

Checking accounts

Phase 12: Fixing reference issues

Finding lost bank references:

Lost references

Updating bank accounts with correct references:

Updating references

Verifying fixes:

Verifying fixes

Phase 13: Final deployment

Running final upgrade:

Final upgrade

Checking module version:

Checking version

Phase 14: Migration result

Successful migration - all records preserved:

Migration result

Checking bank_code values:

Checking bank_code

Phase 15: Verification in Odoo interface

Checking module in Odoo:

Checking module

List of installed modules:

Installed modules

Phase 16: Adding remaining banks

Upgrade with new banks:

Upgrade with banks

Final list of banks with 3-digit codes:

Bank list

Phase 17: Adding Razvojna banka FBiH

Updating CSV for Razvojna banka (code 195):

Razvojna banka

Complete list of banks with codes:

Complete list

Final result

“Banke FBiH” menu with BIC codes display:

Banke FBiH menu

FBiH Banks List

CodeBank
101Privredna banka Sarajevo
102Union banka
132NLB Banka
134ASA Banka
141Bosna Bank International
154Intesa Sanpaolo
161Raiffeisen Bank
186ZiraatBank
194ProCredit Bank
195Razvojna banka FBiH
199Sparkasse Bank
306Addiko bank
338UniCredit Bank

Conclusion

This refactoring brings:

  1. Better organization - bank data is in a separate module
  2. Validation - 16-digit account number, 3-digit bank code
  3. Entity separation - ready for l10n_ba_rs_bank_data and l10n_ba_bd_bank_data
  4. 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