From 2ebd467f8cc30988aca4d3fada5008a84a694054 Mon Sep 17 00:00:00 2001 From: benjamin <benjamin@le-filament.com> Date: Tue, 26 Apr 2022 11:46:44 +0200 Subject: [PATCH] [update] move migration scripts to 13.0 --- migrations/14.0.1.0.0/post-migration.py | 36 ------------------------- migrations/14.0.1.0.0/pre-migration.py | 17 ------------ 2 files changed, 53 deletions(-) delete mode 100644 migrations/14.0.1.0.0/post-migration.py delete mode 100644 migrations/14.0.1.0.0/pre-migration.py diff --git a/migrations/14.0.1.0.0/post-migration.py b/migrations/14.0.1.0.0/post-migration.py deleted file mode 100644 index 0f9a16f..0000000 --- a/migrations/14.0.1.0.0/post-migration.py +++ /dev/null @@ -1,36 +0,0 @@ -# © 2020 Le Filament (<https://www.le-filament.com>) -# © 2020 Confédération Générale des Scop (<https://www.les-scop.coop>) -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - -from openupgradelib import openupgrade - -PERCENT = [ - (0, "0"), - (20, "20"), - (40, "40"), - (60, "60"), - (80, "80"), - (100, "100"), -] - - -def res_partner_map_values(env): - openupgrade.map_values( - env.cr, - openupgrade.get_legacy_name("incub_sensibilite_coop"), - "incub_sensibilite_coop", - PERCENT, - table="res_partner", - ) - openupgrade.map_values( - env.cr, - openupgrade.get_legacy_name("incub_percent_realisation"), - "incub_percent_realisation", - PERCENT, - table="res_partner", - ) - - -@openupgrade.migrate() -def migrate(env, version): - ur_month_timesheet_map_values(env) diff --git a/migrations/14.0.1.0.0/pre-migration.py b/migrations/14.0.1.0.0/pre-migration.py deleted file mode 100644 index 76bf912..0000000 --- a/migrations/14.0.1.0.0/pre-migration.py +++ /dev/null @@ -1,17 +0,0 @@ -# © 2020 Le Filament (<https://www.le-filament.com>) -# © 2020 Confédération Générale des Scop (<https://www.les-scop.coop>) -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - -from openupgradelib import openupgrade - -column_renames = { - "res_partner": [ - ("incub_sensibilite_coop", None), - ("incub_percent_realisation", None), - ], -} - - -@openupgrade.migrate() -def migrate(env, version): - openupgrade.rename_columns(env.cr, column_renames) -- GitLab