forked from OCA/OpenUpgrade
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6cb37b2
commit ec39dbe
Showing
4 changed files
with
57 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
openupgrade_scripts/scripts/hr_holidays/14.0.1.5/post-migration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Copyright (C) 2021 Open Source Integrators | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
from openupgradelib import openupgrade | ||
|
||
|
||
@openupgrade.migrate() | ||
def migrate(env, version): | ||
# Load noupdate changes | ||
openupgrade.load_data(env.cr, "hr_holidays", "14.0.1.5/noupdate_changes.xml") |
45 changes: 45 additions & 0 deletions
45
openupgrade_scripts/scripts/hr_holidays/14.0.1.5/pre-migration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Copyright (C) 2021 Open Source Integrators | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
from openupgradelib import openupgrade | ||
|
||
_field_renames = [ | ||
("hr.leave.type", "hr_leave_type", "validation_type", "leave_validation_type"), | ||
] | ||
xmlid_renames = [ | ||
( | ||
"hr_holidays_calendar.hr_leave_report_calendar_rule_multi_company", | ||
"hr_holidays.hr_leave_report_calendar_rule_multi_company", | ||
), | ||
] | ||
|
||
|
||
@openupgrade.migrate() | ||
def migrate(env, version): | ||
openupgrade.rename_fields(env, _field_renames) | ||
|
||
openupgrade.rename_xmlids(env.cr, xmlid_renames) | ||
|
||
openupgrade.set_xml_ids_noupdate_value( | ||
env, | ||
"hr_holidays", | ||
[ | ||
"hr_holidays_status_rule_multi_company", | ||
"hr_leave_allocation_rule_employee", | ||
"hr_leave_allocation_rule_employee_update", | ||
"hr_leave_allocation_rule_manager", | ||
"hr_leave_allocation_rule_officer_read", | ||
"hr_leave_allocation_rule_officer_update", | ||
"hr_leave_rule_employee", | ||
"hr_leave_rule_employee_unlink", | ||
"hr_leave_rule_employee_update", | ||
"hr_leave_rule_manager", | ||
"hr_leave_rule_multicompany", | ||
"hr_leave_rule_officer_update", | ||
"hr_leave_rule_responsible_read", | ||
"hr_leave_rule_responsible_update", | ||
"hr_leave_rule_user_read", | ||
"resource_leaves_base_user", | ||
"resource_leaves_holidays_user", | ||
], | ||
True, | ||
) |