Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cgscop_timesheet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Le Filament
Confédération Générale des SCOP
cgscop_timesheet
Commits
9fffc105
Commit
9fffc105
authored
2 years ago
by
Benjamin - Le Filament
Browse files
Options
Downloads
Patches
Plain Diff
[update] move migration scripts to 13.0
parent
af85e043
Branches
14.0
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
migrations/14.0.1.0.0/post-migration.py
+0
-40
0 additions, 40 deletions
migrations/14.0.1.0.0/post-migration.py
migrations/14.0.1.0.0/pre-migration.py
+0
-13
0 additions, 13 deletions
migrations/14.0.1.0.0/pre-migration.py
with
0 additions
and
53 deletions
migrations/14.0.1.0.0/post-migration.py
deleted
100644 → 0
+
0
−
40
View file @
af85e043
# © 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
)
This diff is collapsed.
Click to expand it.
migrations/14.0.1.0.0/pre-migration.py
deleted
100644 → 0
+
0
−
13
View file @
af85e043
# © 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
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment