Skip to content

Commit

Permalink
[14.0][MIG] hr_holidays.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chanakya-OSI committed Jul 13, 2021
1 parent 6cb37b2 commit ec39dbe
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docsource/modules130-140.rst
Expand Up @@ -164,7 +164,7 @@ Module coverage 13.0 -> 14.0
+--------------------------------------------+-------------------------------------------------+
|hr_gamification | |
+--------------------------------------------+-------------------------------------------------+
|hr_holidays | |
|hr_holidays | Done |
+--------------------------------------------+-------------------------------------------------+
|hr_holidays_attendance | |
+--------------------------------------------+-------------------------------------------------+
Expand Down
Expand Up @@ -20,7 +20,7 @@
<field name="leave_validation_type">both</field>
</record>
<record id="hr_holidays_status_rule_multi_company" model="ir.rule">
<field name="global"/>
<!-- <field name="global"/> -->
</record>
<record id="hr_leave_allocation_rule_employee" model="ir.rule">
<field name="domain_force">[
Expand Down Expand Up @@ -58,7 +58,7 @@
<field name="name">Allocations: holiday user : create/write</field>
</record>
<record id="hr_leave_rule_multicompany" model="ir.rule">
<field name="global"/>
<!-- <field name="global"/> -->
</record>
<record id="hr_leave_rule_user_read" model="ir.rule">
<field name="perm_create" eval="True"/>
Expand Down
@@ -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 openupgrade_scripts/scripts/hr_holidays/14.0.1.5/pre-migration.py
@@ -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,
)

0 comments on commit ec39dbe

Please sign in to comment.