From dc17bcd2bd06d2d60553a98679a142c92a59aa62 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nguy=E1=BB=85n=20=C4=90=E1=BA=A1i=20D=C6=B0=C6=A1ng?=
 <daiduongnguyen2709@gmail.com>
Date: Thu, 13 Jun 2024 14:00:59 +0700
Subject: [PATCH] [OU-ADD] hr_contract: migration to 17.0

---
 docsource/modules160-170.rst                  |  2 +-
 .../hr_contract/17.0.1.0/post-migration.py    |  9 +++++++
 .../17.0.1.0/upgrade_analysis_work.txt        | 24 +++++++++++++++++++
 3 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 openupgrade_scripts/scripts/hr_contract/17.0.1.0/post-migration.py
 create mode 100644 openupgrade_scripts/scripts/hr_contract/17.0.1.0/upgrade_analysis_work.txt

diff --git a/docsource/modules160-170.rst b/docsource/modules160-170.rst
index 0ae89b703492..fd2e70a5c25e 100644
--- a/docsource/modules160-170.rst
+++ b/docsource/modules160-170.rst
@@ -156,7 +156,7 @@ Module coverage 16.0 -> 17.0
 +---------------------------------------------------+----------------------+-------------------------------------------------+
 | hr_attendance                                     |                      |                                                 |
 +---------------------------------------------------+----------------------+-------------------------------------------------+
-| hr_contract                                       |                      |                                                 |
+| hr_contract                                       | Done                 |                                                 |
 +---------------------------------------------------+----------------------+-------------------------------------------------+
 | hr_expense                                        |                      |                                                 |
 +---------------------------------------------------+----------------------+-------------------------------------------------+
diff --git a/openupgrade_scripts/scripts/hr_contract/17.0.1.0/post-migration.py b/openupgrade_scripts/scripts/hr_contract/17.0.1.0/post-migration.py
new file mode 100644
index 000000000000..13f6b815b2ab
--- /dev/null
+++ b/openupgrade_scripts/scripts/hr_contract/17.0.1.0/post-migration.py
@@ -0,0 +1,9 @@
+# Copyright 2024 Viindoo Technology Joint Stock Company (Viindoo)
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+
+from openupgradelib import openupgrade
+
+
+@openupgrade.migrate()
+def migrate(env, version):
+    openupgrade.load_data(env, "hr_contract", "17.0.1.0/noupdate_changes.xml")
diff --git a/openupgrade_scripts/scripts/hr_contract/17.0.1.0/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/hr_contract/17.0.1.0/upgrade_analysis_work.txt
new file mode 100644
index 000000000000..b74b87cefb72
--- /dev/null
+++ b/openupgrade_scripts/scripts/hr_contract/17.0.1.0/upgrade_analysis_work.txt
@@ -0,0 +1,24 @@
+---Models in module 'hr_contract'---
+---Fields in module 'hr_contract'---
+hr_contract  / hr.contract              / activity_user_id (many2one)   : not related anymore
+hr_contract  / hr.contract              / activity_user_id (many2one)   : now a function
+hr_contract  / hr.contract              / message_has_sms_error (boolean): previously in module sms
+hr_contract  / hr.contract              / message_main_attachment_id (many2one): DEL relation: ir.attachment
+hr_contract  / hr.contract              / rating_ids (one2many)         : NEW relation: rating.rating
+hr_contract  / hr.contract              / website_message_ids (one2many): previously in module portal
+# NOTHING TO DO
+
+hr_contract  / res.company              / contract_expiration_notice_period (integer): NEW hasdefault: default
+hr_contract  / res.company              / work_permit_expiration_notice_period (integer): NEW hasdefault: default
+# NOTHING TO DO: new feature
+
+---XML records in module 'hr_contract'---
+NEW ir.ui.menu: hr_contract.hr_menu_contract
+DEL ir.ui.menu: hr_contract.hr_menu_contract_history
+NEW ir.ui.view: hr_contract.hr_employee_view_graph_inherit_hr_contract
+NEW ir.ui.view: hr_contract.hr_employee_view_pivot_inherit_hr_contract
+NEW ir.ui.view: hr_contract.hr_hr_employee_view_form3
+NEW ir.ui.view: hr_contract.res_config_settings_view_form
+NEW ir.ui.view: hr_contract.view_employee_public_form
+DEL ir.ui.view: hr_contract.hr_employee_public_view_form
+# NOTHING TO DO
