-
-
Notifications
You must be signed in to change notification settings - Fork 820
[19.0][MIG] hr_skills #5736
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
Open
hbrunn
wants to merge
1
commit into
OCA:19.0
Choose a base branch
from
hbrunn:19.0-hr_skills
base: 19.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[19.0][MIG] hr_skills #5736
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
openupgrade_scripts/scripts/hr_skills/19.0.1.0/post-migration.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,60 @@ | ||||||
| # Copyright 2026 Hunki Enterprises BV | ||||||
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||||||
|
|
||||||
| from openupgradelib import openupgrade | ||||||
|
|
||||||
|
|
||||||
| def hr_employee_skill_validity_dates(env): | ||||||
| """ | ||||||
| Set hr.employee.skill#valid_from from hr.employee.skill.log | ||||||
| """ | ||||||
| env.cr.execute( | ||||||
| """ | ||||||
| UPDATE hr_employee_skill hes | ||||||
| SET valid_from = hesl.date | ||||||
| FROM | ||||||
| hr_employee_skill_log hesl | ||||||
| WHERE | ||||||
| hes.employee_id = hesl.employee_id | ||||||
| AND | ||||||
| hes.skill_id = hesl.skill_id | ||||||
| AND | ||||||
| hes.skill_level_id = hesl.skill_level_id | ||||||
| AND | ||||||
| hes.skill_type_id = hesl.skill_type_id | ||||||
| """ | ||||||
| ) | ||||||
|
|
||||||
| env.cr.execute( | ||||||
| """ | ||||||
| UPDATE hr_employee_skill | ||||||
| SET valid_from = create_date | ||||||
| WHERE valid_from IS NULL AND create_date IS NOT NULL | ||||||
| """ | ||||||
| ) | ||||||
|
|
||||||
|
|
||||||
| def hr_job_job_skill_ids(env): | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the field is called job_skill_ids |
||||||
| """ | ||||||
| For every job in hr.job#skill_ids, create a default hr.job.skill entry | ||||||
| (this happens only if hr_recruitment_skills has been installed in v18) | ||||||
| """ | ||||||
| HrJobSkill = env["hr.job.skill"] | ||||||
| for job in env["hr.job"].search([("skill_ids", "!=", False)]): | ||||||
| hr_job_skill_vals = [] | ||||||
| for skill in job.skill_ids: | ||||||
| vals = { | ||||||
| "job_id": job.id, | ||||||
| "skill_id": skill.id, | ||||||
| "skill_type_id": skill.skill_type_id.id, | ||||||
| } | ||||||
| vals["skill_level_id"] = HrJobSkill.new(vals).skill_level_id.id | ||||||
| hr_job_skill_vals.append(vals) | ||||||
| env["hr.job.skill"].create(hr_job_skill_vals) | ||||||
|
|
||||||
|
|
||||||
| @openupgrade.migrate() | ||||||
| def migrate(env, version): | ||||||
| openupgrade.load_data(env, "hr_skills", "19.0.1.0/noupdate_changes.xml") | ||||||
| hr_employee_skill_validity_dates(env) | ||||||
| hr_job_job_skill_ids(env) | ||||||
13 changes: 13 additions & 0 deletions
13
openupgrade_scripts/scripts/hr_skills/19.0.1.0/pre-migration.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # Copyright 2026 Hunki Enterprises BV | ||
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
|
||
| from openupgradelib import openupgrade | ||
|
|
||
| _added_fields = [ | ||
| ("valid_from", "hr.employee.skill", "hr_employee_skill", "date", None, "hr_skills"), | ||
| ] | ||
|
|
||
|
|
||
| @openupgrade.migrate() | ||
| def migrate(env, version): | ||
| openupgrade.add_fields(env, _added_fields) |
125 changes: 125 additions & 0 deletions
125
openupgrade_scripts/scripts/hr_skills/19.0.1.0/upgrade_analysis_work.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,125 @@ | ||
| ---Models in module 'hr_skills'--- | ||
| obsolete model hr.employee.skill.log | ||
|
|
||
| # DONE: used to set hr.employee.skill#{valid_from,valid_to} | ||
|
|
||
| new model hr.employee.certification.report [abstract] | ||
| new model hr.employee.skill.history.report [abstract] | ||
| new model hr.individual.skill.mixin [abstract] | ||
| new model hr.job.skill | ||
|
|
||
| # NOTHING TO DO | ||
|
|
||
| ---Fields in module 'hr_skills'--- | ||
| hr_recruitment_skills / hr.job / skill_ids (many2many) : now a function | ||
| hr_skills / hr.employee / certification_ids (one2many) : NEW relation: hr.employee.skill, hasdefault: compute, stored: False | ||
| hr_skills / hr.employee / current_employee_skill_ids (one2many): NEW relation: hr.employee.skill, hasdefault: compute, stored: False | ||
| hr_skills / hr.employee.skill / display_warning_message (boolean): NEW | ||
|
|
||
| # NOTHING TO DO | ||
|
|
||
| hr_skills / hr.employee.skill / valid_from (date) : NEW hasdefault: default | ||
|
|
||
| # DONE: precreate this column to avoid default in pre-migration, set from hr.employee.skill.log in post-migration | ||
|
|
||
| hr_skills / hr.employee.skill / valid_to (date) : NEW | ||
|
|
||
| # DONE: set from hr.employee.skill.log in post-migration | ||
|
|
||
| hr_skills / hr.employee.skill.log / date (date) : DEL | ||
| hr_skills / hr.employee.skill.log / department_id (many2one) : DEL relation: hr.department | ||
| hr_skills / hr.employee.skill.log / employee_id (many2one) : DEL relation: hr.employee, required | ||
| hr_skills / hr.employee.skill.log / level_progress (integer) : DEL | ||
| hr_skills / hr.employee.skill.log / skill_id (many2one) : DEL relation: hr.skill, required | ||
| hr_skills / hr.employee.skill.log / skill_level_id (many2one) : DEL relation: hr.skill.level, required | ||
| hr_skills / hr.employee.skill.log / skill_type_id (many2one) : DEL relation: hr.skill.type, required | ||
|
|
||
| # DONE: used to set hr.employee.skill#valid_from | ||
|
|
||
| hr_skills / hr.job / current_job_skill_ids (one2many): NEW relation: hr.job.skill, hasdefault: compute, stored: False | ||
| hr_skills / hr.job / job_skill_ids (one2many) : NEW relation: hr.job.skill | ||
|
|
||
| # DONE: create records of hr.job.skill for existing records in hr.job#skill_ids | ||
|
|
||
| hr_skills / hr.job / skill_ids (many2many) : previously in module hr_recruitment_skills | ||
|
|
||
| # NOTHING TO DO | ||
|
|
||
| hr_skills / hr.job.skill / display_warning_message (boolean): NEW | ||
| hr_skills / hr.job.skill / job_id (many2one) : NEW relation: hr.job, required | ||
| hr_skills / hr.job.skill / skill_id (many2one) : NEW relation: hr.skill, required, hasdefault: compute | ||
| hr_skills / hr.job.skill / skill_level_id (many2one) : NEW relation: hr.skill.level, required, hasdefault: compute | ||
| hr_skills / hr.job.skill / skill_type_id (many2one) : NEW relation: hr.skill.type, required, hasdefault: default | ||
| hr_skills / hr.job.skill / valid_from (date) : NEW hasdefault: default | ||
| hr_skills / hr.job.skill / valid_to (date) : NEW | ||
|
|
||
| # DONE: see hr.job#skill_ids | ||
|
|
||
| hr_skills / hr.resume.line / certificate_file (binary) : NEW attachment: True | ||
| hr_skills / hr.resume.line / certificate_filename (char) : NEW | ||
| hr_skills / hr.resume.line / course_type (selection) : NEW required, selection_keys: ['external'], hasdefault: default | ||
| hr_skills / hr.resume.line / department_id (many2one) : previously in module hr_skills_survey | ||
| hr_skills / hr.resume.line / display_type (selection) : DEL selection_keys: ['classic'] | ||
| hr_skills / hr.resume.line / duration (integer) : NEW | ||
| hr_skills / hr.resume.line / external_url (char) : NEW hasdefault: compute | ||
| hr_skills / hr.resume.line / resume_line_properties (properties): NEW hasdefault: compute | ||
| hr_skills / hr.resume.line.type / is_course (boolean) : NEW hasdefault: default | ||
| hr_skills / hr.resume.line.type / resume_line_type_properties_definition (properties_definition): NEW | ||
| hr_skills / hr.skill.level / _order : _order is now 'level_progress' ('level_progress desc') | ||
| hr_skills / hr.skill.level / technical_is_new_default (boolean): NEW hasdefault: compute, stored: False | ||
| hr_skills / hr.skill.type / _order : _order is now 'sequence, name' ('name') | ||
| hr_skills / hr.skill.type / is_certification (boolean) : NEW | ||
| hr_skills / hr.skill.type / levels_count (integer) : NEW hasdefault: compute | ||
| hr_skills / hr.skill.type / sequence (integer) : NEW | ||
| hr_skills / res.users / employee_skill_ids (one2many) : module is now 'project_hr_skills' ('hr_skills') | ||
| hr_skills_survey / hr.resume.line / department_id (many2one) : not stored anymore | ||
|
|
||
| # NOTHING TO DO | ||
|
|
||
| ---XML records in module 'hr_skills'--- | ||
| NEW hr.resume.line.type: hr_skills.resume_type_training [renamed from hr_skills_slides module] | ||
| DEL hr.resume.line.type: hr_skills.resume_type_social_media | ||
| NEW ir.actions.act_window: hr_skills.action_hr_employee_skill_certification | ||
| NEW ir.actions.act_window: hr_skills.hr_employee_certification_report_action [renamed from hr_skills_survey module] (deleted domain) | ||
| NEW ir.actions.act_window: hr_skills.hr_resume_lines_training_action | ||
| DEL ir.actions.act_window: hr_skills.action_hr_employee_skill_log_employee | ||
| NEW ir.cron: hr_skills.hr_job_skills_cron_add_certification_activity_to_employees | ||
| NEW ir.model.access: hr_skills.access_hr_employee_certification_report_user | ||
| NEW ir.model.access: hr_skills.access_hr_employee_skill_history_report | ||
| NEW ir.model.access: hr_skills.access_hr_employee_skill_history_report_manager | ||
| NEW ir.model.access: hr_skills.access_hr_job_skill | ||
| NEW ir.model.access: hr_skills.access_hr_job_skill_employee | ||
| DEL ir.model.access: hr_skills.access_hr_employee_skill_log | ||
| DEL ir.model.access: hr_skills.access_hr_employee_skill_log_manager | ||
| DEL ir.model.constraint: hr_skills.constraint_hr_employee_skill__unique_skill | ||
| DEL ir.model.constraint: hr_skills.constraint_hr_employee_skill_log__unique_skill_log | ||
| NEW ir.rule: hr_skills.hr_employee_skill_history_report_hr_user (noupdate) | ||
| NEW ir.rule: hr_skills.hr_employee_skill_history_report_manager (noupdate) | ||
| NEW ir.ui.menu: hr_skills.hr_certification_menu | ||
| NEW ir.ui.menu: hr_skills.hr_employee_certification_report_menu | ||
| NEW ir.ui.menu: hr_skills.hr_employee_skill_inventory_report_menu | ||
| NEW ir.ui.menu: hr_skills.hr_skill_learning_menu | ||
| NEW ir.ui.menu: hr_skills.menu_learnings_training_attendances | ||
| NEW ir.ui.view: hr_skills.employee_skill_view_inherit_certificate_form | ||
| NEW ir.ui.view: hr_skills.hr_employee_certification_report_view_list | ||
| NEW ir.ui.view: hr_skills.hr_employee_certification_report_view_pivot | ||
| NEW ir.ui.view: hr_skills.hr_employee_certification_report_view_search | ||
| NEW ir.ui.view: hr_skills.hr_employee_skill_history_report_view_graph | ||
| NEW ir.ui.view: hr_skills.hr_employee_skill_history_report_view_search | ||
| NEW ir.ui.view: hr_skills.hr_employee_skill_view_list | ||
| NEW ir.ui.view: hr_skills.hr_employee_skill_view_search | ||
| NEW ir.ui.view: hr_skills.hr_job_skill_view_form | ||
| NEW ir.ui.view: hr_skills.hr_resume_line_calendar_view | ||
| NEW ir.ui.view: hr_skills.hr_resume_line_kanban_view | ||
| NEW ir.ui.view: hr_skills.hr_resume_line_list_view | ||
| NEW ir.ui.view: hr_skills.resume_line_view_form_inherit | ||
| NEW ir.ui.view: hr_skills.view_hr_job_form | ||
| NEW ir.ui.view: hr_skills.view_resume_lines_filter | ||
| DEL ir.ui.view: hr_skills.hr_employee_skill_log_view_graph_department | ||
| DEL ir.ui.view: hr_skills.hr_employee_skill_log_view_graph_employee | ||
| DEL ir.ui.view: hr_skills.hr_employee_skill_log_view_search | ||
| DEL ir.ui.view: hr_skills.hr_employee_skill_log_view_tree | ||
| DEL ir.ui.view: hr_skills.res_users_view_form | ||
| NEW mail.activity.type: hr_skills.mail_activity_data_upload_certification (noupdate) | ||
|
|
||
| # NOTHING TO DO |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about
valid_to?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't know that. and hr_employee_skill_log only contains the last skill, so no way to deduce end times from start times of the next skill level