Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions openupgrade_scripts/scripts/hr_holidays/17.0.1.6/pre-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@
],
}

_field_add = [
(
"number_of_hours",
"hr.leave",
"hr_leave",
"float",
None,
"hr_holidays",
0.0,
),
]


def _pre_create_accrual_plan_active(cr):
"""
Expand Down Expand Up @@ -156,6 +168,7 @@ def migrate(env, version):
openupgrade.rename_models(env.cr, _model_renames)
openupgrade.rename_tables(env.cr, _table_renames)
openupgrade.rename_columns(env.cr, _column_renames)
openupgrade.add_fields(env, _field_add)
_pre_create_accrual_plan_active(env.cr)
_hr_leave_company_id(env.cr)
_map_leave_accrual_level_action(env.cr)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ hr_holidays / hr.leave / mode_company_id (many2one) : not a
# NOTHING TO DO: states removed only

hr_holidays / hr.leave / number_of_days (float) : now a function
# NOTHING TO DO

hr_holidays / hr.leave / number_of_hours (float) : NEW isfunction: function, stored
# NOTHING TO DO: computed fields
# DONE: pre-migration: add column for avoiding the computation

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