From a089964dec8875d80022d216e19b6e832c10ac0c Mon Sep 17 00:00:00 2001 From: benjamin <benjamin@le-filament.com> Date: Mon, 7 Mar 2022 17:25:36 +0100 Subject: [PATCH] [update] migration scripts --- migration/14.0.1.0.0/post-migration.py | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/migration/14.0.1.0.0/post-migration.py b/migration/14.0.1.0.0/post-migration.py index 0191717..f297ff5 100644 --- a/migration/14.0.1.0.0/post-migration.py +++ b/migration/14.0.1.0.0/post-migration.py @@ -7,29 +7,23 @@ from openupgradelib import openupgrade # pylint: disable=W7936 def get_years(): year_list = [] for i in range(2019, 2030): - year_list.append((str(i), str(i))) + year_list.append((i, str(i))) return year_list +def get_months(): + month_list = [] + for i in range(1, 13): + month_list.append((i, str(i))) + return month_list + + def ur_month_timesheet_map_values(env): openupgrade.map_values( env.cr, openupgrade.get_legacy_name("month"), "month", - [ - ("1", "Janv"), - ("2", "Fév"), - ("3", "Mars"), - ("4", "Avr"), - ("5", "Mai"), - ("6", "Juin"), - ("7", "Juil"), - ("8", "Août"), - ("9", "Sept"), - ("10", "Oct"), - ("11", "Nov"), - ("12", "Dec"), - ], + get_months(), table="ur_month_timesheet", ) openupgrade.map_values( -- GitLab