Skip to content

Commit 78e3767

Browse files
authored
Merge pull request #5463 from dixmit/17.0-hr-imp
[17.0][OU-IMP]hr: Add computation of some fields
2 parents a8144e5 + cc25748 commit 78e3767

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

openupgrade_scripts/scripts/hr_holidays/17.0.1.6/pre-migration.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@
2020
],
2121
}
2222

23+
_field_add = [
24+
(
25+
"number_of_hours",
26+
"hr.leave",
27+
"hr_leave",
28+
"float",
29+
None,
30+
"hr_holidays",
31+
0.0,
32+
),
33+
]
34+
2335

2436
def _pre_create_accrual_plan_active(cr):
2537
"""
@@ -156,6 +168,7 @@ def migrate(env, version):
156168
openupgrade.rename_models(env.cr, _model_renames)
157169
openupgrade.rename_tables(env.cr, _table_renames)
158170
openupgrade.rename_columns(env.cr, _column_renames)
171+
openupgrade.add_fields(env, _field_add)
159172
_pre_create_accrual_plan_active(env.cr)
160173
_hr_leave_company_id(env.cr)
161174
_map_leave_accrual_level_action(env.cr)

openupgrade_scripts/scripts/hr_holidays/17.0.1.6/upgrade_analysis_work.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ hr_holidays / hr.leave / mode_company_id (many2one) : not a
2929
# NOTHING TO DO: states removed only
3030

3131
hr_holidays / hr.leave / number_of_days (float) : now a function
32+
# NOTHING TO DO
33+
3234
hr_holidays / hr.leave / number_of_hours (float) : NEW isfunction: function, stored
33-
# NOTHING TO DO: computed fields
35+
# DONE: pre-migration: add column for avoiding the computation
3436

3537
hr_holidays / hr.leave / rating_ids (one2many) : NEW relation: rating.rating
3638
hr_holidays / hr.leave / resource_calendar_id (many2one): NEW relation: resource.calendar, hasdefault: compute

0 commit comments

Comments
 (0)