diff options
| author | Jinane Maksoud <maji@odoo.com> | 2025-01-30 11:28:53 +0100 |
|---|---|---|
| committer | Jinane Maksoud <maji@odoo.com> | 2025-02-06 17:59:32 +0000 |
| commit | 429a8332b2d99600df75fd73ab78bdeb3a048ad2 (patch) | |
| tree | 62d9f3cae4ec4a5c4544c5c9403421bd38b1fe5e | |
| parent | a08b323134be951819f8e1fecccad5b14c5dea5f (diff) | |
[FIX] l10n_fr_account: exclude custom bics from getting xmlid
The upgrade script is supposed to create xmlids for
french banks that were already created from csv, if
it matches custom records that have unusual bic, it
is better to skip the whole record. Replacing the
spaces or unsupported characters in the xmlid will
result in custom records looking like they come from
standard module.
closes odoo/odoo#195740
Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
| -rw-r--r-- | addons/l10n_fr_account/migrations/2.2/pre-migrate-add-bank-xmlid.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/l10n_fr_account/migrations/2.2/pre-migrate-add-bank-xmlid.py b/addons/l10n_fr_account/migrations/2.2/pre-migrate-add-bank-xmlid.py index 1b42a07afca..bdda937dab2 100644 --- a/addons/l10n_fr_account/migrations/2.2/pre-migrate-add-bank-xmlid.py +++ b/addons/l10n_fr_account/migrations/2.2/pre-migrate-add-bank-xmlid.py @@ -10,7 +10,7 @@ def migrate(cr, version): AND d.name = 'fr' AND d.res_id = bank.country WHERE bank.active - AND bank.bic IS NOT NULL + AND bank.bic ~ '^[A-Z0-9]+$' ) INSERT INTO ir_model_data( model, @@ -21,7 +21,7 @@ def migrate(cr, version): ) SELECT 'res.bank', 'l10n_fr_account', - CONCAT('bank_fr_', REPLACE(banks.bic, ' ', '')), + CONCAT('bank_fr_', banks.bic), banks.id, True FROM banks |
