diff --git a/docsource/modules160-170.rst b/docsource/modules160-170.rst index dac6f8a31344..9425f705a685 100644 --- a/docsource/modules160-170.rst +++ b/docsource/modules160-170.rst @@ -184,7 +184,7 @@ Module coverage 16.0 -> 17.0 +---------------------------------------------------+----------------------+-------------------------------------------------+ | hr_presence | |No DB layout changes. | +---------------------------------------------------+----------------------+-------------------------------------------------+ -| hr_recruitment | | | +| hr_recruitment | Done | | +---------------------------------------------------+----------------------+-------------------------------------------------+ | hr_recruitment_skills | | | +---------------------------------------------------+----------------------+-------------------------------------------------+ diff --git a/openupgrade_scripts/scripts/hr_recruitment/17.0.1.1/post-migration.py b/openupgrade_scripts/scripts/hr_recruitment/17.0.1.1/post-migration.py new file mode 100644 index 000000000000..afa175dfd3c6 --- /dev/null +++ b/openupgrade_scripts/scripts/hr_recruitment/17.0.1.1/post-migration.py @@ -0,0 +1,19 @@ +# Copyright 2024- Le Filament (https://le-filament.com) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.load_data(env, "hr_recruitment", "17.0.1.1/noupdate_changes.xml") + openupgrade.delete_record_translations( + env.cr, "hr_recruitment", ["applicant_hired_template"] + ) + openupgrade.delete_records_safely_by_xml_id( + env, + [ + "hr_recruitment.mail_message_interviewer_rule", + "hr_recruitment.mail_alias_jobs", + ], + ) diff --git a/openupgrade_scripts/scripts/hr_recruitment/17.0.1.1/pre-migration.py b/openupgrade_scripts/scripts/hr_recruitment/17.0.1.1/pre-migration.py new file mode 100644 index 000000000000..f4e20b435dca --- /dev/null +++ b/openupgrade_scripts/scripts/hr_recruitment/17.0.1.1/pre-migration.py @@ -0,0 +1,24 @@ +# Copyright 2025 Le Filament (https://le-filament.com) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +from openupgradelib import openupgrade + + +def _fill_sequence_hr_applicant_refuse_reason(cr): + openupgrade.logged_query( + cr, + """ + ALTER TABLE hr_applicant_refuse_reason + ADD COLUMN IF NOT EXISTS sequence INTEGER DEFAULT 10; + """, + ) + openupgrade.logged_query( + cr, + """ + ALTER TABLE hr_applicant_refuse_reason ALTER COLUMN sequence DROP DEFAULT; + """, + ) + + +@openupgrade.migrate(use_env=False) +def migrate(cr, version): + _fill_sequence_hr_applicant_refuse_reason(cr) diff --git a/openupgrade_scripts/scripts/hr_recruitment/17.0.1.1/upgrade_analysis_work.txt b/openupgrade_scripts/scripts/hr_recruitment/17.0.1.1/upgrade_analysis_work.txt new file mode 100644 index 000000000000..ba6f0ffa6b77 --- /dev/null +++ b/openupgrade_scripts/scripts/hr_recruitment/17.0.1.1/upgrade_analysis_work.txt @@ -0,0 +1,49 @@ +---Models in module 'hr_recruitment'--- +---Fields in module 'hr_recruitment'--- +hr_recruitment / hr.applicant / activity_user_id (many2one) : not related anymore +hr_recruitment / hr.applicant / activity_user_id (many2one) : now a function +# NOTHING TO DO: not stored field + +hr_recruitment / hr.applicant / applicant_properties (properties): NEW hasdefault: compute +# NOTHING TO DO: new properties field + +hr_recruitment / hr.applicant / application_status (selection): selection_keys is now '['archived', 'hired', 'ongoing', 'refused']' ('['hired', 'ongoing', 'refused']') +# NOTHING TO DO: extra key added in selection + +hr_recruitment / hr.applicant / email_normalized (char) : NEW isfunction: function, stored +hr_recruitment / hr.applicant / message_bounce (integer) : NEW hasdefault: default +hr_recruitment / hr.applicant / partner_mobile_sanitized (char): NEW isfunction: function, stored +hr_recruitment / hr.applicant / partner_phone_sanitized (char): NEW isfunction: function, stored +hr_recruitment / hr.applicant / phone_mobile_search (char) : NEW +hr_recruitment / hr.applicant / phone_sanitized (char) : NEW isfunction: function, stored +hr_recruitment / hr.applicant / rating_ids (one2many) : NEW relation: rating.rating +# NOTHING TO DO: new fields + +hr_recruitment / hr.applicant.refuse.reason / _order : _order is now 'sequence' ('id') +# NOTHING TO DO: new field sequence used to order + +hr_recruitment / hr.applicant.refuse.reason / sequence (integer) : NEW hasdefault: default +# DONE: pre-migration: pre-create column with default value + +hr_recruitment / hr.job / applicant_properties_definition (properties_definition): NEW +# NOTHING TO DO: new properties field + +hr_recruitment / hr.job / hr_responsible_id (many2one) : DEL relation: res.users +# NOTHING TO DO: responsible field removed without a replacement + +---XML records in module 'hr_recruitment'--- +NEW hr.recruitment.stage: hr_recruitment.stage_job0 (noupdate) +NEW ir.actions.act_window: hr_recruitment.action_hr_applicant_mass_sms +DEL ir.actions.act_window: hr_recruitment.hr_employee_action_from_department +NEW ir.actions.server: hr_recruitment.ir_actions_server_refuse_applicant +NEW ir.config_parameter: hr_recruitment.hr_recruitment_blacklisted_emails (noupdate) +NEW ir.rule: hr_recruitment.hr_applicant_user_rule (noupdate) +NEW ir.rule: hr_recruitment.hr_job_user_rule (noupdate) +NEW ir.rule: hr_recruitment.mail_message_user_rule (noupdate) +NEW ir.ui.view: hr_recruitment.mail_notification_light_without_background (noupdate) +DEL ir.ui.view: hr_recruitment.hr_employee_view_search +# NOTHING TO DO: created by ORM (action_hr_applicant_mass_sms needs SMS installed although not a dependency, see https://github.com/odoo/odoo/issues/191635 + +DEL ir.rule: hr_recruitment.mail_message_interviewer_rule (noupdate) +DEL mail.alias: hr_recruitment.mail_alias_jobs (noupdate) +# DONE post-migration: safe delete these