Skip to content
Snippets Groups Projects
Commit 9fffc105 authored by Benjamin - Le Filament's avatar Benjamin - Le Filament
Browse files

[update] move migration scripts to 13.0

parent af85e043
Branches 14.0
No related tags found
No related merge requests found
# © 2022 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openupgradelib import openupgrade # pylint: disable=W7936
def get_years():
year_list = []
for i in range(2019, 2030):
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",
get_months(),
table="ur_month_timesheet",
)
openupgrade.map_values(
env.cr,
openupgrade.get_legacy_name("year"),
"year",
get_years(),
table="ur_month_timesheet",
)
@openupgrade.migrate()
def migrate(env, version):
ur_month_timesheet_map_values(env)
# © 2022 Le Filament (<http://www.le-filament.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openupgradelib import openupgrade
column_renames = {
"ur_month_timesheet": [("month", None), ("year", None)],
}
@openupgrade.migrate()
def migrate(env, version):
openupgrade.rename_columns(env.cr, column_renames)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment