forked from OCA/l10n-france
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[16.0][FIX] fix digits precision & add post-migration script
- Loading branch information
1 parent
f458fa6
commit 245b535
Showing
2 changed files
with
39 additions
and
4 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
l10n_fr_ecotaxe_sale/migrations/16.0.2.0.0/post-migration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Copyright 2024 Akretion France (http://www.akretion.com/) | ||
# @author Mourad EL HADJ MIMOUNE <[email protected]> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from openupgradelib import openupgrade | ||
|
||
|
||
@openupgrade.migrate() | ||
def migrate(env, version): | ||
# Due to the bug of update module we need to deactivate view | ||
openupgrade.logged_query( | ||
env.cr, | ||
""" | ||
UPDATE ir_ui_view set | ||
active = True | ||
WHERE id in ( | ||
SELECT "ir_ui_view".id FROM "ir_ui_view" | ||
WHERE (("ir_ui_view"."active" = False) | ||
AND (unaccent(COALESCE("ir_ui_view"."arch_db"->>'fr_FR', | ||
"ir_ui_view"."arch_db"->>'en_US')) ilike unaccent('%classification_id%'))) | ||
) | ||
""", | ||
) | ||
openupgrade.logged_query( | ||
env.cr, | ||
""" | ||
UPDATE ir_ui_view set | ||
active = False WHERE id in ( | ||
SELECT "ir_ui_view".id FROM "ir_ui_view" | ||
WHERE (("ir_ui_view"."active" = true) | ||
AND (unaccent(COALESCE("ir_ui_view"."arch_db"->>'fr_FR', | ||
"ir_ui_view"."arch_db"->>'en_US')) ilike unaccent('%ecotaxe_classification_id%'))) | ||
ORDER BY "ir_ui_view"."priority" ASC LIMIT 80) | ||
""", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters