-
-
Notifications
You must be signed in to change notification settings - Fork 802
[19.0][MIG] project + dependencies #5572
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
4
commits into
OCA:19.0
Choose a base branch
from
hbrunn:19.0-project
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
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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
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
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
10 changes: 10 additions & 0 deletions
10
openupgrade_scripts/scripts/project/19.0.1.3/end-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,10 @@ | ||
| # Copyright 2026 Hunki Enterprises BV | ||
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
|
||
| from openupgradelib import openupgrade | ||
|
|
||
|
|
||
| @openupgrade.migrate() | ||
| def migrate(env, version): | ||
| # set project groups according to features used in projects | ||
| env["project.project"]._check_project_group_at_removal() |
84 changes: 84 additions & 0 deletions
84
openupgrade_scripts/scripts/project/19.0.1.3/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,84 @@ | ||
| # Copyright 2026 Hunki Enterprises BV | ||
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
|
||
| from openupgradelib import openupgrade | ||
|
|
||
|
|
||
| def project_project_allow_recurring_tasks(env): | ||
| """ | ||
| Set project_project#allow_recurring_tasks if there's a recurring task in | ||
| project | ||
| """ | ||
| env.cr.execute( | ||
| """ | ||
| UPDATE project_project | ||
| SET allow_recurring_tasks=True | ||
| FROM | ||
| project_task | ||
| WHERE | ||
| project_task.project_id=project_project.id | ||
| AND | ||
| project_task.recurring_task | ||
| """ | ||
| ) | ||
|
|
||
|
|
||
| def project_task_type_rating(env): | ||
| """ | ||
| Rating related fields have been moved from project.project to project.task.type | ||
| Use settings from most recent project | ||
| """ | ||
| for task_type in env["project.task.type"].search([("project_ids", "!=", False)]): | ||
| env.cr.execute( | ||
| """ | ||
| SELECT | ||
| rating_active, rating_request_deadline, | ||
| rating_status, rating_status_period | ||
| FROM project_project | ||
| WHERE id in %s | ||
| ORDER BY write_date DESC | ||
| LIMIT 1 | ||
| """, | ||
| (tuple(task_type.project_ids.ids),), | ||
| ) | ||
| for vals in env.cr.dictfetchall(): | ||
| task_type.write(vals) | ||
|
|
||
|
|
||
| def project_task_priority(env): | ||
| """ | ||
| Map priorities of "1" (v18 high) to "2" (v19 high), but only if there are no | ||
| existing priorities of "2" or "3", pointing to project_task_add_very_high | ||
| being installed in v18 | ||
| """ | ||
| env.cr.execute( | ||
| "SELECT EXISTS (SELECT id FROM project_task WHERE priority IN ('2', '3'))" | ||
| ) | ||
| if env.cr.fetchone()[0]: | ||
| return | ||
| env.cr.execute( | ||
| """ | ||
| UPDATE project_task | ||
| SET | ||
| priority='2' | ||
| WHERE | ||
| priority='1' | ||
| """ | ||
| ) | ||
|
|
||
|
|
||
| @openupgrade.migrate() | ||
| def migrate(env, version): | ||
| project_project_allow_recurring_tasks(env) | ||
| project_task_type_rating(env) | ||
| project_task_priority(env) | ||
| openupgrade.load_data(env, "project", "19.0.1.3/noupdate_changes.xml") | ||
| openupgrade.delete_record_translations( | ||
| env.cr, | ||
| "project", | ||
| [ | ||
| "mail_template_data_project_task", | ||
| "rating_project_request_email_template", | ||
| ], | ||
| ["body_html"], | ||
| ) | ||
128 changes: 128 additions & 0 deletions
128
openupgrade_scripts/scripts/project/19.0.1.3/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,128 @@ | ||
| ---Models in module 'project'--- | ||
| new model project.role | ||
| new model project.template.create.wizard [transient] | ||
| new model project.template.role.to.users.map [transient] | ||
| new model task.share.wizard [transient] | ||
|
|
||
| # NOTHING TO DO | ||
|
|
||
| ---Fields in module 'project'--- | ||
| project / project.milestone / _order : _order is now 'sequence, deadline, is_reached desc, name' ('deadline, is_reached desc, name') | ||
| project / project.milestone / sequence (integer) : NEW hasdefault: default | ||
|
|
||
| # NOTHING TO DO | ||
|
|
||
| project / project.project / allow_recurring_tasks (boolean): NEW | ||
|
|
||
| # DONE: set from task recurrence | ||
|
|
||
| project / project.project / is_template (boolean) : NEW | ||
|
|
||
| # NOTHING TO DO | ||
|
|
||
| project / project.project / privacy_visibility (selection): selection_keys added: [invited_users] (most likely nothing to do) | ||
|
|
||
| # NOTHING TO DO | ||
|
|
||
| project / project.project / rating_active (boolean) : DEL | ||
| project / project.project / rating_request_deadline (datetime): DEL | ||
| project / project.project / rating_status (selection) : DEL required, selection_keys: ['periodic', 'stage'] | ||
| project / project.project / rating_status_period (selection): DEL required, selection_keys: ['bimonthly', 'daily', 'monthly', 'quarterly', 'weekly', 'yearly'] | ||
|
|
||
| # DONE: used to set corresponding fields on project.task.type | ||
|
|
||
| project / project.project.stage / color (integer) : NEW | ||
| project / project.role / active (boolean) : NEW hasdefault: default | ||
| project / project.role / color (integer) : NEW hasdefault: default | ||
| project / project.role / name (char) : NEW required, translate | ||
| project / project.role / sequence (integer) : NEW | ||
| project / project.task / display_in_project (boolean) : now a function | ||
| project / project.task / email_from (char) : previously in module website_project | ||
| project / project.task / has_template_ancestor (boolean): NEW isfunction: function, stored | ||
| project / project.task / is_template (boolean) : NEW | ||
| project / project.task / partner_phone (char) : previously in module website_project | ||
| project / project.task / personal_stage_type_id (many2one): not a function anymore | ||
| project / project.task / personal_stage_type_id (many2one): now related | ||
|
|
||
| # NOTHING TO DO | ||
|
|
||
| project / project.task / priority (selection) : selection_keys added: [2, 3] (most likely nothing to do) | ||
|
|
||
| # DONE: mapped "1" (v18 high) to "2" (v19 high) | ||
|
|
||
| project / project.task / role_ids (many2many) : NEW relation: project.role | ||
| project / project.task.type / color (integer) : NEW | ||
|
|
||
| # NOTHING TO DO | ||
|
|
||
| project / project.task.type / rating_active (boolean) : NEW | ||
| project / project.task.type / rating_request_deadline (datetime): NEW isfunction: function, stored | ||
| project / project.task.type / rating_status (selection) : NEW required, selection_keys: ['periodic', 'stage'], hasdefault: default | ||
| project / project.task.type / rating_status_period (selection): NEW required, selection_keys: ['bimonthly', 'daily', 'monthly', 'quarterly', 'weekly', 'yearly'], hasdefault: default | ||
|
|
||
| # DONE: set from corresponding fields on project.project | ||
|
|
||
| project / project.task.type / rotting_threshold_days (integer): NEW hasdefault: default | ||
|
|
||
| # NOTHING TO DO | ||
|
|
||
| project / res.users / favorite_project_ids (many2many): NEW relation: project.project | ||
|
|
||
| # NOTHING TO DO: inverse of existing project.project#favorite_user_ids | ||
|
|
||
| ---XML records in module 'project'--- | ||
| NEW ir.actions.act_window: project.mail_followers_edit_action_from_task | ||
| NEW ir.actions.act_window: project.project_milestone_action | ||
| NEW ir.actions.act_window: project.project_milestone_action_view_tasks | ||
| NEW ir.actions.act_window: project.project_roles_action | ||
| NEW ir.actions.act_window.view: project.action_view_project_milestone_form | ||
| NEW ir.actions.act_window.view: project.action_view_project_milestone_kanban | ||
| NEW ir.actions.act_window.view: project.action_view_project_milestone_list | ||
| NEW ir.actions.act_window.view: project.project_milestone_action_view_graph | ||
| NEW ir.actions.act_window.view: project.project_milestone_action_view_pivot | ||
| NEW ir.actions.act_window.view: project.project_milestone_action_view_tasks_calendar | ||
| NEW ir.actions.act_window.view: project.project_milestone_action_view_tasks_kanban | ||
| NEW ir.actions.act_window.view: project.project_milestone_action_view_tasks_list | ||
| NEW ir.actions.act_window.view: project.project_roles_action_kanban | ||
| NEW ir.actions.act_window.view: project.project_roles_action_list | ||
| NEW ir.actions.server: project.action_server_convert_project_to_template | ||
| NEW ir.actions.server: project.action_server_convert_to_template | ||
| DEL ir.actions.server: project.action_server_view_my_task | ||
| NEW ir.embedded.actions: project.project_embedded_action_project_milestones | ||
| NEW ir.embedded.actions: project.project_embedded_action_update_milestones | ||
| NEW ir.model.access: project.access_project_role_manager | ||
| NEW ir.model.access: project.access_project_role_user | ||
| NEW ir.model.access: project.access_project_task_share_manager | ||
| NEW ir.model.access: project.access_project_task_share_user | ||
| NEW ir.model.access: project.access_project_template_create_wizard_manager | ||
| NEW ir.model.access: project.access_project_template_create_wizard_user | ||
| NEW ir.model.access: project.access_project_template_role_to_users_map_manager | ||
| NEW ir.model.access: project.access_project_template_role_to_users_map_user | ||
| NEW ir.model.constraint: project.constraint_mail_message_date_res_id_id_for_burndown_chart | ||
| NEW ir.model.constraint: project.constraint_project_task_is_template_idx | ||
| NEW ir.ui.menu: project.project_menu_config_project_roles | ||
| NEW ir.ui.view: project.portal_my_tasks_badge_widget_template | ||
| NEW ir.ui.view: project.portal_task_share_wizard | ||
| NEW ir.ui.view: project.project_milestone_view_kanban | ||
| NEW ir.ui.view: project.project_project_view_form_simplified_template | ||
| NEW ir.ui.view: project.project_role_view_form | ||
| NEW ir.ui.view: project.project_role_view_kanban | ||
| NEW ir.ui.view: project.project_role_view_list | ||
| NEW ir.ui.view: project.project_role_view_search | ||
| NEW ir.ui.view: project.project_task_graph_view_project_milestone | ||
| NEW ir.ui.view: project.project_task_kanban_view_project_milestone | ||
| NEW ir.ui.view: project.project_task_pivot_view_project_milestone | ||
| NEW ir.ui.view: project.project_task_templates_kanban | ||
| NEW ir.ui.view: project.project_task_templates_list | ||
| NEW ir.ui.view: project.project_task_tree_view_project_milestone | ||
| NEW ir.ui.view: project.project_templates_view_form | ||
| NEW ir.ui.view: project.project_templates_view_kanban | ||
| NEW ir.ui.view: project.project_templates_view_list | ||
| NEW ir.ui.view: project.view_task_template_search_form | ||
| DEL ir.ui.view: project.project_sharing | ||
| DEL ir.ui.view: project.project_sharing_embed | ||
| DEL ir.ui.view: project.rating_rating_project_view_kanban | ||
| DEL res.groups: project.group_project_rating | ||
| NEW res.groups.privilege: project.res_groups_privilege_project | ||
|
|
||
| # NOTHING TO DO |
9 changes: 9 additions & 0 deletions
9
openupgrade_scripts/scripts/rating/19.0.1.1/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,9 @@ | ||
| # Copyright 2026 Hunki Enterprises BV | ||
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
|
||
| from openupgradelib import openupgrade | ||
|
|
||
|
|
||
| @openupgrade.migrate() | ||
| def migrate(env, version): | ||
| env.cr.execute("UPDATE rating_rating SET rated_on=write_date") |
20 changes: 20 additions & 0 deletions
20
openupgrade_scripts/scripts/rating/19.0.1.1/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,20 @@ | ||
| ---Models in module 'rating'--- | ||
| ---Fields in module 'rating'--- | ||
| rating / gamification.badge.user / rating_ids (one2many) : NEW relation: rating.rating | ||
| rating / ir.actions.server / rating_ids (one2many) : NEW relation: rating.rating | ||
| rating / ir.cron / rating_ids (one2many) : NEW relation: rating.rating | ||
| rating / maintenance.equipment.category / rating_ids (one2many) : DEL relation: rating.rating | ||
| rating / maintenance.team / rating_ids (one2many) : NEW relation: rating.rating | ||
|
|
||
| # NOTHING TO DO | ||
|
|
||
| rating / rating.rating / rated_on (datetime) : NEW | ||
|
|
||
| # DONE: set from write_date | ||
|
|
||
| ---XML records in module 'rating'--- | ||
| NEW ir.model.constraint: rating.constraint_rating_rating_consumed_idx | ||
| NEW ir.model.constraint: rating.constraint_rating_rating_parent_consumed_idx | ||
| DEL ir.ui.view: rating.rating_rating_view_form_complete | ||
|
|
||
| # 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.
Please, could you transform all this in one query?