Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[15.0][MIG] hr_contract: Migration scripts #3688

Merged
merged 2 commits into from
Jan 13, 2023
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
2 changes: 1 addition & 1 deletion docsource/modules140-150.rst
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ Module coverage 14.0 -> 15.0
+-------------------------------------------------+----------------------+-------------------------------------------------+
| hr_attendance |Nothing to do | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
| hr_contract | | |
| hr_contract | Done | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
| hr_expense | | |
+-------------------------------------------------+----------------------+-------------------------------------------------+
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from openupgradelib import openupgrade


@openupgrade.migrate()
def migrate(env, version):
column = openupgrade.get_legacy_name("notes")
openupgrade.convert_field_to_html(
env.cr, "hr_contract", column, "notes", verbose=True
)
12 changes: 12 additions & 0 deletions openupgrade_scripts/scripts/hr_contract/15.0.1.0/pre-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from openupgradelib import openupgrade

_columns_copy = {
"hr_contract": [
("notes", None, None),
],
}


@openupgrade.migrate()
def migrate(env, version):
openupgrade.copy_columns(env.cr, _columns_copy)
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---Models in module 'hr_contract'---
new model hr.contract.history [sql_view]
new model hr.contract.type
---Fields in module 'hr_contract'---
hr_contract / hr.contract / contract_type_id (many2one) : NEW relation: hr.contract.type
# NOTHING TO DO: new feature on 15.0

hr_contract / hr.contract / notes (text) : type is now 'html' ('text')
# DONE: pre-migration: copied column for preserving old content
# DONE: post-migration: convert text to html

hr_contract / hr.contract.type / name (char) : NEW required
# NOTHING TO DO: new model for new feature on 15.0

hr_contract / hr.employee / first_contract_date (date) : is now stored
# NOTHING TO DO: computed in load

---XML records in module 'hr_contract'---
NEW ir.actions.act_window: hr_contract.hr_contract_history_to_review_view_list_action
NEW ir.actions.act_window: hr_contract.hr_contract_history_view_form_action
NEW ir.actions.act_window: hr_contract.hr_contract_history_view_list_action
NEW ir.ui.view: hr_contract.hr_contract_history_view_form
NEW ir.ui.view: hr_contract.hr_contract_history_view_kanban
NEW ir.ui.view: hr_contract.hr_contract_history_view_list
NEW ir.ui.view: hr_contract.hr_contract_history_view_search
NEW ir.ui.view: hr_contract.hr_employee_public_view_form
NEW ir.ui.view: hr_contract.resource_calendar_view_form
NEW ir.ui.view: hr_contract.resource_calendar_view_tree
NEW ir.ui.view: hr_contract.view_employee_tree
NEW ir.model.access: hr_contract.access_hr_contract_history_manager
NEW ir.model.access: hr_contract.access_hr_contract_type_manager
NEW ir.rule: hr_contract.ir_rule_hr_contract_history_multi_company (noupdate)
NEW ir.ui.menu: hr_contract.hr_menu_contract_history
# NOTHING TO DO

DEL ir.actions.act_window: hr_contract.act_hr_employee_2_hr_contract
DEL ir.ui.menu: hr_contract.hr_menu_contract
DEL ir.ui.view: hr_contract.assets_backend
# NOTHING TO DO: noupdate="0" records