Skip to content

Commit 1412c27

Browse files
authored
Merge pull request #3688 from Tecnativa/v15_mig_hr_contract_2
[15.0][MIG] hr_contract: Migration scripts
2 parents 7fe0976 + 0bb9a55 commit 1412c27

File tree

4 files changed

+61
-1
lines changed

4 files changed

+61
-1
lines changed

docsource/modules140-150.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ Module coverage 14.0 -> 15.0
174174
+-------------------------------------------------+----------------------+-------------------------------------------------+
175175
| hr_attendance |Nothing to do | |
176176
+-------------------------------------------------+----------------------+-------------------------------------------------+
177-
| hr_contract | | |
177+
| hr_contract | Done | |
178178
+-------------------------------------------------+----------------------+-------------------------------------------------+
179179
| hr_expense | | |
180180
+-------------------------------------------------+----------------------+-------------------------------------------------+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from openupgradelib import openupgrade
2+
3+
4+
@openupgrade.migrate()
5+
def migrate(env, version):
6+
column = openupgrade.get_legacy_name("notes")
7+
openupgrade.convert_field_to_html(
8+
env.cr, "hr_contract", column, "notes", verbose=True
9+
)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from openupgradelib import openupgrade
2+
3+
_columns_copy = {
4+
"hr_contract": [
5+
("notes", None, None),
6+
],
7+
}
8+
9+
10+
@openupgrade.migrate()
11+
def migrate(env, version):
12+
openupgrade.copy_columns(env.cr, _columns_copy)
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---Models in module 'hr_contract'---
2+
new model hr.contract.history [sql_view]
3+
new model hr.contract.type
4+
---Fields in module 'hr_contract'---
5+
hr_contract / hr.contract / contract_type_id (many2one) : NEW relation: hr.contract.type
6+
# NOTHING TO DO: new feature on 15.0
7+
8+
hr_contract / hr.contract / notes (text) : type is now 'html' ('text')
9+
# DONE: pre-migration: copied column for preserving old content
10+
# DONE: post-migration: convert text to html
11+
12+
hr_contract / hr.contract.type / name (char) : NEW required
13+
# NOTHING TO DO: new model for new feature on 15.0
14+
15+
hr_contract / hr.employee / first_contract_date (date) : is now stored
16+
# NOTHING TO DO: computed in load
17+
18+
---XML records in module 'hr_contract'---
19+
NEW ir.actions.act_window: hr_contract.hr_contract_history_to_review_view_list_action
20+
NEW ir.actions.act_window: hr_contract.hr_contract_history_view_form_action
21+
NEW ir.actions.act_window: hr_contract.hr_contract_history_view_list_action
22+
NEW ir.ui.view: hr_contract.hr_contract_history_view_form
23+
NEW ir.ui.view: hr_contract.hr_contract_history_view_kanban
24+
NEW ir.ui.view: hr_contract.hr_contract_history_view_list
25+
NEW ir.ui.view: hr_contract.hr_contract_history_view_search
26+
NEW ir.ui.view: hr_contract.hr_employee_public_view_form
27+
NEW ir.ui.view: hr_contract.resource_calendar_view_form
28+
NEW ir.ui.view: hr_contract.resource_calendar_view_tree
29+
NEW ir.ui.view: hr_contract.view_employee_tree
30+
NEW ir.model.access: hr_contract.access_hr_contract_history_manager
31+
NEW ir.model.access: hr_contract.access_hr_contract_type_manager
32+
NEW ir.rule: hr_contract.ir_rule_hr_contract_history_multi_company (noupdate)
33+
NEW ir.ui.menu: hr_contract.hr_menu_contract_history
34+
# NOTHING TO DO
35+
36+
DEL ir.actions.act_window: hr_contract.act_hr_employee_2_hr_contract
37+
DEL ir.ui.menu: hr_contract.hr_menu_contract
38+
DEL ir.ui.view: hr_contract.assets_backend
39+
# NOTHING TO DO: noupdate="0" records

0 commit comments

Comments
 (0)